标签:source this spec expec specified pytho average 统计 scheme
SLOC(Source Lines of Code),是一套用于统计项目中用到的多种源代码总行数的工具。此外,SLOC 还会估算出开发该项目所需的工作量、所需人员和时间等项目成本(基于 COCOMO 模型)。目前 SLOC 支持的语言多达 27 种。
sudo rpm -ivh sloccount-2.26-1.i386.rpm
sudo apt-get install sloccount
语法:sloccount directory_name
示例(以 tensorflow 源码为例)
$ sloccount tensorflow-master
...
SLOC Directory SLOC-by-Language (Sorted)
1929666 tensorflow cpp=1313054,python=571706,java=15935,ansic=10758,
pascal=8380,sh=8343,objc=1172,cs=168,perl=150
75546 third_party cpp=72614,python=2799,sh=96,lisp=37
1016 top_dir python=1008,sh=8
130 tools sh=130
Totals grouped by language (dominant language first):
cpp: 1385668 (69.06%)
python: 575513 (28.68%)
java: 15935 (0.79%)
ansic: 10758 (0.54%)
sh: 8577 (0.43%)
pascal: 8380 (0.42%)
objc: 1172 (0.06%)
cs: 168 (0.01%)
perl: 150 (0.01%)
lisp: 37 (0.00%)
Total Physical Source Lines of Code (SLOC) = 2,006,358
Development Effort Estimate, Person-Years (Person-Months) = 586.89 (7,042.71)
(Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
Schedule Estimate, Years (Months) = 6.04 (72.46)
(Basic COCOMO model, Months = 2.5 * (person-months**0.38))
Estimated Average Number of Developers (Effort/Schedule) = 97.20
Total Estimated Cost to Develop = $ 79,281,247
(average salary = $56,286/year, overhead = 2.40).
SLOCCount, Copyright (C) 2001-2004 David A. Wheeler
SLOCCount is Open Source Software/Free Software, licensed under the GNU GPL.
SLOCCount comes with ABSOLUTELY NO WARRANTY, and you are welcome to
redistribute it under certain conditions as specified by the GNU GPL license;
see the documentation for details.
Please credit this data as "generated using David A. Wheeler's 'SLOCCount'."
参考资料:
https://dwheeler.com/sloccount/sloccount.html
标签:source this spec expec specified pytho average 统计 scheme
原文地址:https://www.cnblogs.com/offduty/p/11736400.html