Saturday, May 14, 2011

Counting code - Ohcount vs Cloc

We have lots of evil csh which we want to convert to bash or even perl or python. So I decided to test some code line counting tools to estimate the effort involved in terms of pure lines of code. I tested 2 options: the old and venerable cloc and the child of web 2.0 ohcount. Like the definition of the metre, what constitutes a line of code can vary a bit.
Ohloh Line Count Summary
Examining 16633 file(s)
LanguageFilesCodeCommentComment %BlankTotal
java273722755110247631.1%61095391122
xml18148762754705.9%313496231
xmlschema41869194874311.2%75378690
javascript42341392938618.5%509655874
html429196755802.9%202522280
css8686976196.6%195111267
sql1072892463.3%1687703
xslt47309263617.1%5694297
php260011015.5%102812
bat11575223.7%166763
scala5552356.0%99686
python2954478659.1%4191749
shell185029515.9%99696
make6356246.3%78458
Total603646770712922821.6%75759672694
Cloc gives similar numbers off by a few thousand and separated by csh vs bash. Ohcount could do with some more shell script discrimination.
Post a Comment