http://cloc.sourceforge.net/

cloc counts blank lines, comment lines, and physical lines of source code in many programming languages