What is the prefered score range for the code metrics calculation for the following
- Maintainability Index
- Cyclomatic Complexity
- Depth of Inheritance
- class Coupling
What is the prefered score range for the code metrics calculation for the following
The theoretically optimal values are:
There are no hard and fast "good" ranges, though it's possible to make some general statements.
A project could only reach all four values simultaneously by essentially doing nothing and being useless: software that does nothing and depends on nothing is certainly maintainable, but not a very good use of client dollars.
Therefore, all complexity is a tradeoff: additional so-called inherent complexity encodes more sophistication into the program, allowing it to expand the feature set. What you would like to avoid is accidental complexity introduced by a poor or deficient implementation.
Before relying too heavily on it (or relying on it at all), check the following page, which gives more detail on how the metric is computed:
https://avandeursen.com/2014/08/29/think-twice-before-using-the-maintainability-index/
VS' Maintainability Index is a poorly-validated combination of metrics, which itself relies a metric (cyclomatic complexity) that has been shown to not correlate with code understandability (which would therefore not correlate with maintainability). See "Automatically Assessing Code Understandability: How Far Are We?", by Scalabrino et al. and https://shape-of-code.com/?s=cyclomatic+complexity
Furthermore, the constants and function choices used in this metric have not been calibrated on C# or VB code, which further makes it useless.
(This addresses the original question by pointing out that the original question should not even be asked.)