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”
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.
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
You can get it opened in the excel. See, the filters are automatically applied for header items!
