views:

922

answers:

7

I'm looking for a tool that can collect quality metrics for C#/.NET code. I'm aware of NDepend - are there any other tools that I should look into? Ideally, I'd like to find something that could be integrated with an automated build process - something that could export a text-based report (I'd like to be able to easily email and archive these). I'm interested in metrics like line of code, cyclomatic complexity, public methods per class, statements per method, calls per method, coupling/cohesion factors, etc.

My goal is to examine the evolution of the codebase as it evolves. Each build represents a checkpoint at which a new set of functional requirements have been completed. I would like to be able to identify which changes are introducing the most complexity and quality risks to the codebase.

+1  A: 

AQTime includes some tools for static analysis in addition to their standard profilers, which can be called from a command line on a project.

Reed Copsey
+1  A: 

Although it does not produce the metrics you mention, you have already added FxCop to your build process, right? The static analysis it performs and the feedback it provides are a very good starting point before adding anything more complex.

jerryjvl
Yes, we have FxCop running as part of the build. Unfortunately, since we can't typically address all of the issues it finds, it ends up producing a lot of "noise".
LBushkin
The suggested approach to avoid 'noise' is to make a config file including the rules you want to apply, and using that as an input to FxCop (I think you can create the required .FxCop file from within the FxCop IDE). That way you can pick the high-value rules first, and leave the rest turned off, and then progressively activate more rules as the developers get used to best practices. (And some FxCop rules may very well just never apply... some can be a bit pedantic in specific dev scenarios)
jerryjvl
Supposedly it is also possible to define custom FxCop rules: http://www.binarycoder.net/fxcop/index.html
emddudley
On the same line, StyleCop. This one is more oriented towards code formatting but still a nice tool.
Sorin Comanescu
A: 

Crap4j is a tool for measuring Change Risk Analysis and Predictions, I was trying to find a .NET port, but no luck here. I know our QA department has been using some homegrown tools to measure CRAP, so I'll check with them tomorrow. Checked - it is currently an internal only project.

See also this question.

plinth
Reminds me of the Special High Intensity Training program I once took...
Charlie Salts
A: 

Simian (Similarity Analyser) identifies duplication in Java, C#, C, C++, COBOL, Ruby, JSP, ASP, HTML, XML, Visual Basic, Groovy source code and even plain text files.

http://www.redhillconsulting.com.au/products/simian/

Simon
A: 

OxyProject Metrics is both standalone and a VS plug in, good for lines of code, comments, classes but not more sophisticated measurements. Handles C#, C++, VB.NET and can export CSVs.

I'm including it in this list even though it doesn't offer all the features you want because those developers using Express versions may find it useful, since they can't use Add-Ins.

Martin
A: 

Understand is a great tool that I personally use at work. Understand website

C Johnson
A: 

Hi,

Did u get the answer for your question? Actually we are also trying to do something similar. Weare using Fxcop/Simian and we want to automate the execution of these tools with the build process. Please let me know if you got any idea.

Thanks.

Veeru