The Code Metrics Viewer extension integrates the Code Metrics Power Tool 10.0 (provided by Microsoft) into Visual Studio Professional 2010. In order to use this extension, the Code Metrics Power Tool 10.0 application needs to be downloaded and installed separately.
The download can be found at:
I have created a project blog, where you can get all information about the extension:
I am working on this extension in my leisure time - and I am sharing it with you for free. You, as a developer know at best that software is never perfect - and in some cases it might not work as expected. So, if you have any problems, please don´t hesitate to open a thread in the Q & A section or send me an email (you will find my email at the blog); I will try to do my best and I will respond as soon as possible. There is only one thing I am asking for... If you like the tool, please rate it!
What is Code Metrics Viewer and what is it for?
Well, the Code Metrics Power Tool calculates the maintainablity index, cyclomatic complexity, class coupling, depth of inheritance and lines of code for types and members of a specific assembly. Code metrics are more or less concerned about to measure evolvability of a software system, which is an indicator of the inner quality of software.
Visual Studio 2010 Professional does not support any calculation of code metrics. If you have missed that feature, then this extension is for you. The Code Metrics Viewer extension integrates the Code Metrics Power Tool 10.0 into the development environment and allows calcualtion of metrics whenever you want. Before you can analyze a solution, the tool path needs to be setup correctly in the options dialog.
How to get it working?
The extension comes up with it´s own options page, where you can specifiy the installation path of the Code Metrics Power Tool. Please have a look at the Readme-file provided together with the Code Metrics Power Tool 10.0 to find out the installation folder (might be: \Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop). The specified path shall not contain a filename (the extension will add the name of the executable). Consider that there is a difference in the path between 32- and 64-bit versions of Windows.
Where can I find the Code Metrics Viewer in Visual Studio?
The Code Metrics Viewer window is accesible via the "Other Windows" menu. You´ll also find the "Code Metrics Viewer" command in the context menu of the solution root in the Solution Explorer.
How can I calculate code metrics?
After a solution was loaded and successfully build, it can be analyzed by pressing the "Analyze Solution" button. The Code Metrics Viewer will utilize the power tool to create the code metric report for each assembly in the solution. Depending on the solution size, this can take a while... The results will be shown in the grid.
The filter bar can be used to navigate quickly through the report.
Can I use the tool in Visual Studio 2012?
No, not this version... there´s another contribution that targets Code Metrics Power Tool 11.0 and Visual Studio 2012. See:/vsgallery/adceaf09-3fb8-47dc-91b3-cfb3f9b7fafa