[visual-studio] How do you count the lines of code in a Visual Studio solution?

cloc is an excellent commandline, Perl-based, Windows-executable which will break down the blank lines, commented lines, and source lines of code, grouped by file-formats.

Now it won't specifically run on a VS solution file, but it can recurse through directories, and you can set up filename filters as you see fit.

Here's the sample output from their web page:


prompt> cloc perl-5.10.0.tar.gz
    4076 text files.
    3883 unique files.                                          
    1521 files ignored.

http://cloc.sourceforge.net v 1.07  T=10.0 s (251.0 files/s, 84566.5 lines/s)
-------------------------------------------------------------------------------
Language          files     blank   comment      code    scale   3rd gen. equiv
-------------------------------------------------------------------------------
Perl               2052    110356    112521    309778 x   4.00 =     1239112.00
C                   135     18718     22862    140483 x   0.77 =      108171.91
C/C++ Header        147      7650     12093     44042 x   1.00 =       44042.00
Bourne Shell        116      3402      5789     36882 x   3.81 =      140520.42
Lisp                  1       684      2242      7515 x   1.25 =        9393.75
make                  7       498       473      2044 x   2.50 =        5110.00
C++                  10       312       277      2000 x   1.51 =        3020.00
XML                  26       231         0      1972 x   1.90 =        3746.80
yacc                  2       128        97      1549 x   1.51 =        2338.99
YAML                  2         2         0       489 x   0.90 =         440.10
DOS Batch            11        85        50       322 x   0.63 =         202.86
HTML                  1        19         2        98 x   1.90 =         186.20
-------------------------------------------------------------------------------
SUM:               2510    142085    156406    547174 x   2.84 =     1556285.03
-------------------------------------------------------------------------------

The third generation equivalent scale is a rough estimate of how much code it would take in a third generation language. Not terribly useful, but interesting anyway.