Sorry, your browser cannot access this site
This page requires browser support (enable) JavaScript
Learn more >

cloc

下载

Linux(Ubuntu):

TODO

macOS:

1
2
3
4
5
# Mac OS X
brew install cloc

# 检查是否安装成功
cloc --version

使用

1
2
3
4
5
# 统计当前目录下的所有代码的代码行数
cloc ./

# 统计当前目录下的所有代码的代码行数,排除Pods子目录
cloc ./ --exclude-dir=Pods

输出结果

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
➜  src git:(develop) ✗ cloc ./common_util 
38 text files.
37 unique files.
1 file ignored.

github.com/AlDanial/cloc v 2.00 T=0.05 s (768.5 files/s, 105387.8 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C++ 17 346 332 2503
C/C++ Header 19 184 1155 448
CMake 1 16 31 59
-------------------------------------------------------------------------------
SUM: 37 546 1518 3010
-------------------------------------------------------------------------------

参考文档

https://blog.csdn.net/jimojianghu/article/details/129792250

评论