Jeff and .NET

The .NET musings of Jeff Putz

Sponsors

News

My Sites

Archives

Is there a way to count lines of code in a project?

Does VS 2005 have some way to count the lines of code in a project? It's not any kind of vital statistic to me as much as I'm just curious.
Posted: Nov 10 2005, 01:21 PM by Jeff | with 8 comment(s)
Filed under: ,

Comments

Kyle said:

I haven't tried this out, but here's a "Macro to count lines of code in .cs files" from GotDotNet...

http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=fb625d28-2c99-4066-a158-4b9cfe5ced98
# November 10, 2005 1:57 PM

Kyle said:

Sorry for the double post, but here's probably a better way...

http://www.codeproject.com/macro/linecount.asp
# November 10, 2005 2:01 PM

Kyle Finley said:

I have wanted the same feature and a while back I just wrote a little vbscript that will count the lines in various files.

http://kylefinley.net/archive/2005/10/03/18.aspx

This could easily be modified to be a macro. I only wanted it for curiosity sake on an old project.
# November 10, 2005 2:28 PM

Erik Porter said:

If there's nothing that does what you want, you may want to put it up on Product Feedback as a suggestion too. I'd vote for it if you did. I've wanted something similar for a long, long time. Would be neat to see what percent of lines of code in my app I actually wrote myself and how much was generated code, etc
# November 10, 2005 2:48 PM

Jon Galloway said:

Check out the DPack addins -

There's a stats view that includes totals as well as breakdowns by comment and code lines (and support for copying to clipboard):
http://www.usysware.com/dpack/Stats.aspx

It's free, and the VS2005 RTM version has been released.
# November 10, 2005 3:19 PM

Jon Galloway said:

Oh, and the DPack main page: http://www.usysware.com/DPack/Default.aspx
# November 10, 2005 3:20 PM

Kenny said:

You can always do a regular expression search. Just enter the character . (full stop) in the search box to find all non empty lines. The count shows up in the Find Results window.
# November 10, 2005 3:26 PM

Johan Hultgren said:

I recommend Source Monitor from http://www.campwoodsw.com/ .
# November 11, 2005 10:11 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)