Visual Studio 2010 – Code Metrics calculation

Visual Studio 2010 provides a new feature to calculate various the code metrics. Sadly this options are only available for Managed projects. Sorry native developers!

It allows to calculate the follow matrices of your project

  • Maintainability index
  • Cyclomatic Complexity
  • Depth of Inheritance
  • Class Coupling
  • Lines of code

Most of us mainly interested lines of code (LOC) as various other calculations in the project life cycle calculated based on this.

To calculate Code matrix, Right click on the Solution and choose “Calculate Code Metrics”

image

As you’re seeing above, you can see the information for the entire project and also for the individual items.

It’s possible to filter the results based on given criteria as you’re seeing below.

image

The coolest things is that, you can export these result to an excel sheet without any pain. Just right click on the item and “Open Selection in Microsoft Excel” as you’re seeing below

image

You can get it opened in the excel. See, the filters are automatically applied for header items!

image

To know more check MSDN website.

This entry was posted in Uncategorized. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>