How to evalulate your code: "Calculate Code Metrics" in Visual Studio 2008
Do you know What is "Calculate Code Metrics" as a new feature of Visual Studio 2008
![]() |
I have wanted to know how to evaluate my code easily. But It is not easy to buy the solution privately for that. :) Like preparing the exam into University, it helps to enhance our programming skill. Programming and rating it. And we can do it using Visual Studio 2008 easily. |
InfoSys posted "Calculate Code Metrics Features in Visual Studio 2008"
It is a good post. It is easy to read and understand about "Calculate Code Metric". All the thing you have to for "Calculate Code Metric" are just two steps.
- Click Mouse right button on your Visual Studio Solution and select "Calculate Code Metrics".
- Read five indices, which means the followings
Meaning of the indices are explained in here. The summary of that is following.
Maintainability Index: This index tells how maintainable your code is. It is like a total score. Higher the value better your code is.
Cyclomatic Complexity: This index is calculated at a method level. and it tells how complex the relation between methods in your code is. So lower the value better your code is.
Depth of Inheritance: This tells the number of base classes. it is good to maintain the number of inheritance appropriately. Infosys recommended to keep this value to 6 or below
Class Coupling: This number shows the number of classes a particular class depends on. It is better to keep this value lower.
Lines of Code; It tells the number of lines except white space, comments, braces and so on. So it can shows your daily work.
It is easy, isn't it?
Trackback URL >> http://crowsley2.cafe24.com/trackback/18

