I use cloc
and it works just fine. It understands pretty much any language or script out there, it's easy to install - comes as a package on Linux, and easy to use. It can also output to multiple formats like csv, xml, yaml, sql, etc
. Here is an example output of one of my projects:
# cloc .
1145 text files.
853 unique files.
937 files ignored.
http://cloc.sourceforge.net v 1.60 T=23.05 s (25.5 files/s, 8260.4 lines/s)
--------------------------------------------------------------------------------
Language files blank comment code
--------------------------------------------------------------------------------
XML 383 311 26 150875
Javascript 18 2330 948 9904
Scala 132 1689 1901 8029
CSS 8 1266 163 7373
HTML 23 459 91 2835
SQL 11 11 5 877
XSLT 1 30 16 468
Bourne Shell 9 57 108 240
Perl 1 57 102 227
Bourne Again Shell 1 2 0 3
DOS Batch 1 0 0 2
--------------------------------------------------------------------------------
SUM: 588 6212 3360 180833
--------------------------------------------------------------------------------