统计项目代码行数Count Lines of Code(CLOC)

本文介绍了一款名为CLOC的小型命令行工具,该工具可在Windows环境下帮助开发者快速统计指定目录下各种编程语言的代码行数,包括空行、注释及实际代码行数。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

统计代码总行数挺麻烦的 VS2010里虽然有Code Metrics Analyze 但这个工具只能用在托管的项目中 于是在这里找到一个小的命令行工具统计代码行数

用法很简单 如下(转自Wiki

How to use CLOC in Windows

(1) Download the program

(2) Open command prompt

(3) Run program with syntax: <exe program> <code file dir>

(4) Program will print out a table with statictics on every programming language it can recognise in the given directory

(5) -> SLOC is the amount of "code" lines

(6) -> LOC is the sum of "blank" + "comment" + "code" lines


Simple Example

cloc-1.08.exe D:\Users\temp\code_files\my_program
      21 text files.
      21 unique files.
       0 files ignored.

http://cloc.sourceforge.net v 1.08  T=0.5 s (42.0 files/s, 9658.0 lines/s)
-------------------------------------------------------------------------------
Language          files     blank   comment      code    scale   3rd gen. equiv
-------------------------------------------------------------------------------
Java                 10       518       164      1979 x   1.36 =        2691.44
CSS                   3       129        28       739 x   1.00 =         739.00
PHP                   5       176       128       505 x   3.50 =        1767.50
HTML                  3        60        34       369 x   1.90 =         701.10
-------------------------------------------------------------------------------
SUM:                 21       883       354      3592 x   1.64 =        5899.04
-------------------------------------------------------------------------------

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值