[other] 代码量代码复杂度统计-lizard
lizard的可以用来统计下面的一些数据
- 不包含代码注释的代码行数
- CCN 代码的复杂度,也就是分支复杂度
- token的个数(关键字,标示符,常量,标点符号,操作符)
- 函数的参数个数
支持下列的一些语言
- C/C++ (works with C++14)
- Java
- C# (C Sharp)
- JavaScript
- Objective C
- Swift
- Python
- Ruby
- TTCN-3
- PHP
- Scala
- GDScript
downloadlink
https://github.com/terryyin/lizard
优点
- 不需要头文件全部指定(宏展开可能有失偏颇)
- 能够同时统计代码量和代码复杂度
- 能够产生和cppNCSS相同的报告
缺点
- c/c++的三字符组和双字符组
- c/c++的代码预处理和宏扩展没有实现
- c++的一些模版
对应的可以选择的参数
usage: lizard [options] [PATH or FILE] [PATH] ...
lizard is an extensible Cyclomatic Complexity Analyzer for many programming
languages including C/C++ (doesn't require all the header files). For more
information visit http://www.lizard.ws
positional arguments:
paths list of the filename/paths.
optional arguments:
-h, --help show this help message and exit
--version show program's version number and exit
-l LANGUAGES, --languages LANGUAGES
List the programming languages you want to analyze. if
left empty, it'll search for all languages it knows.
`lizard -l cpp -l java`searches for C++ and Java code.
The available languages are: cpp, java, csharp,
javascript, python, objectivec, ttcn, ruby, php,
swift, scala, GDScript
-V, --verbose Output in verbose mode (long function name)
-C CCN, --CCN CCN Threshold for cyclomatic complexity number warning.
The default value is 15. Functions with CCN bigger
than it will generate warning
-f INPUT_FILE, --input_fil