
Code Metrics Results window
After Visual Studio analyzes your code, it displays the results in the Code Metrics Results window. The window has a toolbar at the top and columns for displaying the results that are calculated.
The Hierarchy column contains a tree view of the code hierarchy that you can expand or collapse to see the level of detail that you need. The remaining columns show the calculated results. You can hide or arrange the result columns as you want. For more information, see How to: Add, Remove, or Rearrange Columns.
The Maintainability column contains an icon in addition to the numeric result. A green icon indicates a relatively high degree of maintainability. A yellow icon indicates a moderate degree of maintainability. A red icon indicates low maintainability and a potential trouble spot. These color indicators correspond to severity categories that are used by the FxCop rule AvoidUnmaintainableCode. This rule fires an error if the maintainability index is lower than 10, a warning if the index is between 10 and 20, and neither an error nor warning if the index is higher than 20. The maintainability index is a synthesis of three metrics: cyclomatic complexity, lines of code, and computational complexity. Its values are not expressed in units.
You can sort the results in the window by any column. To do this, click the column heading. Click the column heading again, and the window will be sorted in reverse order.