views:

237

answers:

2

I have a client that thought a highly dynamic ASP.NET application was a very simple sytem, yet to implement it in the manner in which they needed for future grown it has grown to well over 100 different code files.

I am looking for a way, most likely with some sort of static code analysis tool to put some numbers that might "make sense" to a non-technical person. I fully understand that Lines of Code and other metrics are not really "valid" items to evaluate, but in this case this is the type of thing I need, Lines of Code, Number of XML comments, Total Files, Total Folders.

I know I can look some of these up, but I'm looking for an easy way to get these values in bulk! I found a few old posts here, but nothing that specifically talked about .NET (Current versions) and/or C#.

Ideally I want something that can investigate a C# WAP project. SQL Server would be an AWESOME value add, but not a 100% needed item!

A: 

For simple lines of code and comment mix and such, I have found the VS plugin "Project Line Counter" very good (http://www.codeproject.com/KB/macros/linecount.aspx).

If you want more detailed metrics, and I would suggest a simple explanation of cyclomatic complexity will lead to a deeper understanding by your client, and respect for what you know. Tools like Reflector have plugins that will show complexity and class size as block diagrams. See http://www.codeplex.com/reflectoraddins, or more specifically http://www.codeplex.com/reflectoraddins/Wiki/View.aspx?title=CodeMetrics.

Bernhard Hofmann
A: 

You can use the tool NDepend to get 82 code metrics like # of Lines of Code, # of parameters for methods, # of method callers, percentage comment for a method, percentage of code coverage by tests, ranking (most popular methods/types...).

All 82 metrics are listed on this page http://www.ndepend.com/Metrics.aspx.

Also, Code Metrics is one of the 11 major features of NDepend:
- Code Query Language (CQL)
- Compare Builds
- 82 code metrics
- Manage Complexity and Dependencies
- Detect Dependency Cycles
- Harness Test Coverage Data
- Enforce Immutability and Purity
- Warnings about the health of your Build Process
- Generate custom report from your Build Process
- Diagrams
- Facilities to cope with real-world environment

Patrick Smacchia - NDepend dev
THAT IS PERFECT! Exactly what I needed!
Mitchel Sellers