SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
ASP.NET, VB.NET, Microsoft .NET Framework, Microsoft Visual Studio, Windows Forms, Controls and more Tutorials and Articles for Programmers


Visual Studio Code Metrics for VS2010


Visual Studio Code Metrics is a tool that .NET Framework developers can use to calculate code metrics for .NET projects and .NET codes.
Visual Studio Code Metrics can be used as a command line as well as from the VS2010 IDE.

Microsoft Visual Studio Code Metrics PowerTool calculates the following code metrics for managed code.
The output calculated code metrics can be exported to a file in XML format.
The code metrics that is reported by Visual Studio Code Metrics in VS2010 include :
Maintainability Index,
Cyclomatic Complexity,
Depth of Inheritance,
Class Coupling, and
Lines Of Code (LOC).





In order to display code metrics of a Microsoft Visual Studio 2010 project or a VS2010 solution, open Visual Studio 2010.
Open the solution or VS2010 project.
From top menu in Visual Studio 2010 screen, select Analyze > Calculate Code Metrics for Solution options.

visual-studio-2010-code-metrics-tool

Another method is to right-click on the solution or project node in Visual Studio 2010 Solution Explorer.
From the context menu select Calculate Code Metrics option.

Code Metrics will display detailed information in a similar interface shown in below screenshot.

calculate-visual-studio-2010-code-metrics-for-vs2010-project

Microsoft .NET Framework programmers can free download Microsoft Visual Studio Code Metrics PowerTool 10.0 from Microsoft Downloads portal.
The download file is MetricsSetup.exe and its size is only 365KB.

When the Code Metrics tool is installed, the installer adds Metrics.exe and MetricsReport.xsd files under the below path :
C:\Program Files\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop

Unfortunately for using Visual Studio Code Metrics, Visual Studio 2010 Ultimate, Visual Studio 2010 Premium or Team Foundation Server 2010 is a requirement.



Visual Studio


Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.