Computing Visual Studio Code Metrics during Builds

Microsoft have just released a new command line tool for computing the same code metrics that Visual Studio provides.  These include Maintainability Index, Cyclomatic Complexity, Class Coupling, Depth of Inheritance, and Lines of Code. The tool is named Metrics.exe and can be downloaded here.

The results will be placed in an XML file whose schema matches the provided MetricsReport.xsd.  Jakob Ehn has already documented how to integrate this with TFS 2010 Build.  All that’s needed is an XSL file to integrate with CruiseControl.NET.

Thanks to Cameron Skinner for the announcement of the tool.

Update (1 Feb 2011): Please note that .NET Framework 4.0 is required for this tool.  Also it requires version of Microsoft.VisualStudio.CodeAnalysis.Common so you should have Visual Studio 2010 installed.


2 Responses to Computing Visual Studio Code Metrics during Builds

  1. […] in CruiseControl.NET 1 February, 2011 Craig Sutherland Leave a comment Go to comments posted about how Microsoft has released a command-line version for generating static code metrics. […]

  2. Craig Sutherland says:

    Hi Krip

    That’s an easy enough request –



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: