推荐一个代码行数统计工具cloc

来源:互联网 发布:perceptron算法 编辑:程序博客网 时间:2024/05/05 14:45

代码行数统计工具cloc,它不但能统计代码行数,还能自动过滤掉代码中的注释,使用起来也很方便,强力推荐。

安装很方便,Ubuntu上直接udo apt-get install cloc就可以了

下面用mysql来做个例子吧,首先进入mysql的源代码文件夹:

qch@qch ~/aproject $ cd mysql-5.6.19/qch@qch ~/aproject/mysql-5.6.19 $ cloc .defined(%hash) is deprecated at /usr/bin/cloc line 1277.(Maybe you should just omit the defined()?)   13804 text files.   13319 unique files.                                              9686 files ignored.http://cloc.sourceforge.net v 1.53  T=17.0 s (241.0 files/s, 143571.1 lines/s)--------------------------------------------------------------------------------Language                      files          blank        comment           code--------------------------------------------------------------------------------C++                            1153         187301         209441         937741C                               519          36218          40159         457187C/C++ Header                   1389          51302         114475         206003Java                            612          13120          19048          54595Perl                            142           9515           6892          30931Bourne Shell                    142           5293           5848          28855XML                              47            965           1242           7847SQL                              23            764            822           5791Python                            4            346            271           1264Teamcenter def                   21             20            135           1032Pascal                            8              0           1403            969yacc                              2            152             64            810HTML                              5             40             53            524lex                               3            219            102            524D                                 9             59             -9            494Javascript                        1             33             62            131make                              3             39             26            108m4                                1              7             27             75DOS Batch                         8             36             78             69awk                               1              2             15             54Bourne Again Shell                1              8             16             28YAML                              1              0              0             16SKILL                             1              8             15             16Visual Basic                      1              0              0             12--------------------------------------------------------------------------------SUM:                           4097         305447         400185        1735076--------------------------------------------------------------------------------
搞定。


0 0