Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Roslyn Metrics Utility
Roslyn Metrics Utility

Roslyn Metrics Utility

Matthias Friedrich

|
1,836 installs
| (3) | Free
A console application to calculate code metrics for your C# projects. The utility uses the Microsoft .NET Compiler Platform "Roslyn" API for the code analysis and metrics result calculation.
Download

Roslyn Metrics Utility

It is a console application that is aimed to calculate code metrics of your C# projects. The utility uses the Microsoft .NET Compiler Platform "Roslyn" API for the code analysis and metrics-result calculation.

This is pre-release software that is not intended to be used in a live operating environment. The software is licensed "as-is" and you bear the risk of using it.

How to use the utility?

The utility expects two arguments; the solution- or project-file (/file) to process and the result filename (/out). You can specify these arguments as shown below...

roslynmetrics.exe /file:"<solution-file>" /out:"<xml-file>

Since the utility does not calculate metric results on IL but on source code, the utility can produce results even for projects which cannot be built (for instance due to missing dependencies). Please keep in mind, that results calculated by this application might differ from similar tools, which work on IL because the source code won´t be optimized before calculation.

What metrics are calculated?

The application calculates the following 32 metrics: Maintainability Index (MI), Cyclomatic Complexity (CCN2), Class Coupling, Depth of Inheritance Tree (DIT), Lack of Cohesion of Methods (LCOM), Lack of Cohesion of Methods (Henderson Sellers) (LCOMHS), (Effective) Lines of Code (LOC), Lines of Comments, Number of Namespaces, Number of Types, Number of Methods, Number of Fields, Number of Parameters, Number of Local Variables.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft