Visual Studio Code Metrics

How to Generate Code Metrics Data

  • Click Analysis menu, then click Calculate Code Metrics for Solution

1. Maintainability Index
+ Measures ease of code maintenance. Higher values are better.
+ No individual method or property should have a maintainability index lower than 40

2. Cyclomatic Complexity
+ Measures number of branches. Lower values are better.
+ No individual method or property should have a cyclomatic complexity greater than 10

3. Depth of Inheritance
+ Measures length of object inheritance hierarchy. Lower values are better.
+ No individual type should have object inheritance hierarchy greater than 4

4. Class Coupling
+ Measures number of classes that are referenced. Lower values are better.
+ No individual type, method or property should have class coupling greater than 10

5. Lines of Code
+ Approximates the lines of executable code (IL code). Lower values are better.
+ Not a good measure by itself

References

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s