zhangboyang / NEMU-linecount

line of code counter and grapher for NEMU

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NEMU 代码行数统计工具

NEMU 的代码行数统计小工具,可以根据 git 的历史记录,绘制代码行数随时间变化的曲线图。

示例

绘图结果

example

图例解释

nemu-total, kernel-total, game-total 分别代表 nemu, kernel, game 部分的新添加的代码行数(含空白行)。

total 是新添加的代码行数的总和。

total-space 是新添加的空白行(完全由空白字符组成的行)数量的总和。

使用方法

首先需要安装 gnuplot 程序,以 ubuntu 为例:

sudo apt-get install gnuplot

将 linecount.sh 和 plotlinecount.gnu 放入 NEMU 的根目录下。

进入 NEMU 根目录,执行以下命令来生成代码统计数据文件 lcdata.txt (该过程耗时较长):

./linecount.sh > lcdata.txt

执行以下命令,用数据文件 lcdata.txt 中的数据来绘图:

gnuplot -e "lcfile='lcdata.txt'" plotlinecount.gnu 

About

line of code counter and grapher for NEMU

License:MIT License


Languages

Language:Shell 67.4%Language:Gnuplot 32.6%