« Home | Linux當AP找不到Lib時 » | uClibc » | MS公司的備忘錄 » | 電子工程專輯列出的商業RTOS » | PalmSource加入OSDL » | Linux Boot Logo Support » | Linux有多少發行套件呢? » | GCC Linker Script » | 我的新玩具Mighty Mouse » | 幾個監看/改變Linux系統的記憶體/Process/CPU使用有關的指令 » 

2005/12/07 

統計程式碼行數的工具

Thursday, December 8, 2005
12/7/2005 7:48:03 PM

統計程式碼行數的工具
David A. Wheeler 的SLOCCount,這是一個General Public License(GPL)開放原始碼,它支援非常多的程式語言(27種,包含shell,script),有趣的是它也會算出程式碼的成本,以下是對Linux Kernel 2.6.12-3的結果。
Creating filelist for arch
Have a non-directory at the top, so creating directory top_dir
Adding /usr/src/linux-2.6.12.3/COPYING to top_dir
Adding /usr/src/linux-2.6.12.3/CREDITS to top_dir
Creating filelist for crypto
Creating filelist for Documentation
Creating filelist for drivers
Creating filelist for fs
Creating filelist for include
Creating filelist for init
Creating filelist for ipc
Creating filelist for kernel
Creating filelist for lib
Adding /usr/src/linux-2.6.12.3/MAINTAINERS to top_dir
Adding /usr/src/linux-2.6.12.3/Makefile to top_dir
Creating filelist for mm
Creating filelist for net
Adding /usr/src/linux-2.6.12.3/README to top_dir
Adding /usr/src/linux-2.6.12.3/REPORTING-BUGS to top_dir
Creating filelist for scripts
Creating filelist for security
Creating filelist for sound
Creating filelist for usr
Categorizing files.
Finding a working MD5 command....
Found a working MD5 command.
Warning: in include, number of duplicates=119
Computing results.
Warning: file /usr/src/linux-2.6.12.3/arch/arm/mm/proc-arm1020e.S line 431 has unmatched comment end
Warning: file /usr/src/linux-2.6.12.3/arch/arm/mm/proc-arm1020.S line 449 has unmatched comment end


SLOC Directory SLOC-by-Language (Sorted)
2127382 drivers ansic=2121424,asm=2637,yacc=1651,perl=829,lex=763,
sh=78
766120 arch ansic=580685,asm=185016,sh=204,awk=99,python=45,
pascal=41,perl=30
394456 include ansic=392849,asm=1277,cpp=330
376134 fs ansic=376134
332482 sound ansic=332299,asm=183
245952 net ansic=245952
27413 kernel ansic=27413
18865 mm ansic=18865
17822 scripts ansic=11962,perl=2052,cpp=1429,yacc=952,lex=750,
sh=595,python=82
17092 security ansic=17092
13455 crypto ansic=13455
9293 lib ansic=9293
4566 ipc ansic=4566
2551 Documentation ansic=1183,sh=866,perl=284,lisp=218
2113 init ansic=2113
445 usr ansic=443,asm=2
0 top_dir (none)


Totals grouped by language (dominant language first):
ansic: 4155728 (95.40%)
asm: 189115 (4.34%)
perl: 3195 (0.07%)
yacc: 2603 (0.06%)
cpp: 1759 (0.04%)
sh: 1743 (0.04%)
lex: 1513 (0.03%)
lisp: 218 (0.01%)
python: 127 (0.00%)
awk: 99 (0.00%)
pascal: 41 (0.00%)




Total Physical Source Lines of Code (SLOC) = 4,356,141
Development Effort Estimate, Person-Years (Person-Months) = 1,324.61 (15,895.28)
(Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
Schedule Estimate, Years (Months) = 8.23 (98.72)
(Basic COCOMO model, Months = 2.5 * (person-months**0.38))
Estimated Average Number of Developers (Effort/Schedule) = 161.01
Total Estimated Cost to Develop = $ 178,936,381
(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'."

About me

  • I'm Martin's blog 馬汀的部落格
  • From 中壢市, 桃園縣, Taiwan
  • -----BEGIN GEEK CODE BLOCK----- Version: 3.1 Comment: For info see http://www.geekcode.com GC/CS/CC/E/IT/TW d- s a C++++ L++++ P+ L++++ E--- W+++ N++ o+ K- w+++ O- M- V- PS+ PE++ Y+ PGP+ t 5- X++ R- tv- b+++ DI+ D-- G e+++ h+ r+ y+ z? ------END GEEK CODE BLOCK------ /**************************** 旅行是我生命的動力 它的樂趣從計劃旅行開始 我樂於分享旅行及Linux Kernel上的每一件事. ****************************/
My profile