Line counter for ASP.NET

I know that the number of lines of code is completely arbitrary and a terrible metric. Despite this, after a long day I like to click on the small button and see that my pet project has grown by 10%. (Or, if I spent the day refactoring again, it decreased by 10%, woohoo!)

I used two line counters that could analyze code from CodeProject in the past, but they process .cs files, completely rejecting my extensive work in .aspx, .asmx, .js, .css, etc.

Has anyone used a line counter that could parse all text files commonly found on a regular ASP.NET site?

Update

CMS recommended CLOC , which really was exactly what I was looking for. Here is my conclusion for the curious. He even counted my MSBuild script!

  C: \ Web> cloc-1.06.exe --exclude-dir = .svn, bin, images AST
      474 text files.
      474 unique files.
    28254 files ignored.

 http://cloc.sourceforge.net v 1.06 T = 70.0 s (6.3 files / s, 737.7 lines / s)
 -------------------------------------------------- -----------------------------
 Language files blank comment code scale 3rd gen.  equiv
 -------------------------------------------------- -----------------------------
 C # 332 4670 9666 21255 x 1.36 = 28906.80
 ASP.Net 91 58 0 4053 x 1.29 = 5228.37
 Javascript 9 1262 2112 4011 x 1.48 = 5936.28
 CSS 5 193 42 1665 x 1.00 = 1665.00
 MSBuild scripts 1 0 7 1413 x 1.90 = 2684.70
 HTML 2 126 5 429 x 1.90 = 815.10
 XML 1 0 0 392 x 1.90 = 744.80
 PHP 1 21 13 249 x 3.50 = 871.50
 -------------------------------------------------- -----------------------------
 SUM: 442 6330 11845 33467 x 1.40 = 46852.55
 -------------------------------------------------- -----------------------------
+4
source share
2 answers

See CLOC

Check the output:

------------------------------------------------------------------------------- Language files blank comment code scale 3rd gen. equiv ------------------------------------------------------------------------------- ASP.Net 21 290 0 3424 x 1.29 = 4416.96 XML 1 0 0 26 x 1.90 = 49.40 DOS Batch 1 1 0 8 x 0.63 = 5.04 C# 1 0 0 4 x 1.36 = 5.44 ------------------------------------------------------------------------------- SUM: 24 291 0 3462 x 1.29 = 4476.84 ------------------------------------------------------------------------------- 

You can also check other code counters:

+6
source

You may be able to get the same level of satisfaction from taking unit tests. Although this number can also be misleading, at least unit tests (if not just done to increase your score) are of some importance to the quality of your code.

+3
source

All Articles