I have just installed the Visual Studio Power Tool for code analysis and the viewer for the results. Great tools, by the way!
When I click "Analyze Solution" I get the results:
I understand what these all mean, except that there are different values of "depth of inheritance" for each method in a class, and a larger one for the class.
Does anyone have an explanation of what this might be saying?
Method of calculation the Depth of Inheritance Tree is the maximum level reached by walking the dependency tree of A, then B1 and B2, recursively so until an element is encountered which does not Extends anything.
=> 85 - Highly Maintainable. 65 - 85 - Moderately Maintainable. <= 65 - Difficult to Maintain.
Developers can use Visual Studio to generate code metrics data that measure the complexity and maintainability of their managed code. Code metrics data can be generated for an entire solution or a single project.
Basically, class coupling is a measure of how many classes a single class uses. A high number is bad and a low number is usually good with this metric. Class coupling has been shown to be an accurate predictor of software failure and recent studies have shown that an upper-limit value of 9 is the most efficient S2010.
As each derived class extends the previous class, it adds additional functionality. It can add properties or methods that didn't exist in the previous base class. Now the the total set of methods is larger than it was for the base class. This process can be repeated when the derived class is derived from again.
So if you take the most derived class and pick a method A
and follow it down to the base class that first implemented A
, it might be a different deeper class than if you pick method B
and follow it down to the first base class that implemented B
. This is why the depth of inheritance can be different for different methods.
If you take the class itself, it has a clear series of base classes and a clear depth of its own, independent of the depth of the methods, which are always the same or less the class itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With