C# Number of Code lines vs Number of Comment lines

Associate
Joined
7 Nov 2005
Posts
746
Location
Southampton, UK
Does anyone know of a tool that will show how many lines of code and how many lines of comments there are in a c# file or better yet project or solution (usable within Visual Studio 2008 or not)?

Thanks
 
Does anyone know of a tool that will show how many lines of code and how many lines of comments there are in a c# file or better yet project or solution (usable within Visual Studio 2008 or not)?

Thanks

Can't you just do ?
grep '<comment identifier>' file | wc -l
 
Last edited:
Can't you just do ?
grep '<comment identifier>' file | wc -l

That wouldn't necessarily give you information about multiline comments though, assuming you want a two line comment to show as two lines of comments and not just one comment.

There is a tool (there's probably many, but I've used this one before) that does what you're after:
http://www.slickedit.com/content/view/441/#SLOCReport

I think it has a limit of 5000 files per solution though as it ran into problems analysing one of ours at work saying it was too big!
 
Back
Top Bottom