Implement the Maintainability Index Code Metric #4657
Labels
difficulty-02-ducky
Resolving these involves the internal API, but with relatively easy problems to solve.
enhancement
Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope.
feature-code-metrics
up-for-grabs
Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky
To enable closing the overarching issue of Code Metrics that originally only intended to deal with an initial implementation, this issue is a follow-up taking one of the proposed inspections and putting it into it's own issue.
The MaintainabilityIndex of a code base is computed by the magic formula:
The result is clamped to 0. HV stands for the "Halstead Volume", CC stands for "Cyclomatic Complexity" and LoC is just "Lines of Code". The latter two are already implemented as working Code Metrics.
The Halstead Volume is computed as
N * log_2("distinct operators")
, where N stands for the total number of operands and operators. This roughly corresponds to tokens.The text was updated successfully, but these errors were encountered: