Sloccount is great package to use when you have a directory and group of directories that you want to have sloccount of . You get output such as this -
Computing results.
SLOC Directory SLOC-by-Language (Sorted)
64535 top_dir cpp=60050,sh=4346,objc=123,sed=16
Totals grouped by language (dominant language first):
cpp: 60050 (93.05%)
sh: 4346 (6.73%)
objc: 123 (0.19%)
sed: 16 (0.02%)
Total Physical Source Lines of Code (SLOC) = 64,535
Development Effort Estimate, Person-Years (Person-Months) = 15.90 (190.76)
(Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05))
Schedule Estimate, Years (Months) = 1.53 (18.39)
(Basic COCOMO model, Months = 2.5 * (person-months**0.38))
Estimated Average Number of Developers (Effort/Schedule) = 10.37
Total Estimated Cost to Develop = $ 2,147,468
(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'."
But it fails completely when you try to use a .deb package or an .tar.gz archive. Is there another package which can do this without trying to figure switches for it ?
[$] sloccount debdelta_0.55.tar.gz
Have a non-directory at the top, so creating directory top_dir
Adding /home/shirish/games/debdelta_0.55.tar.gz to top_dir
Categorizing files.
Computing results.
SLOC Directory SLOC-by-Language (Sorted)
0 top_dir (none)
SLOC total is zero, no further analysis performed.
OR
[$] sloccount i-nex_7.6.0_amd64.deb
Have a non-directory at the top, so creating directory top_dir
Adding /home/shirish/games/i-nex_7.6.0_amd64.deb to top_dir
Categorizing files.
Computing results.
SLOC Directory SLOC-by-Language (Sorted)
0 top_dir (none)
SLOC total is zero, no further analysis performed.