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 10.0.0.0 of Microsoft.VisualStudio.CodeAnalysis.Common so you should have Visual Studio 2010 installed.

-Krip

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 http://blog.kynetix.com/2011/01/31/computing-visual-studio-code-metrics-during-builds/ 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 – http://csut017.wordpress.com/2011/02/01/visual-studio-code-metrics-in-cruisecontrol-net/
    :-)

    Craig

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: