Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the Maintainability Index Code Metric #4657

Open
Vogel612 opened this issue Dec 18, 2018 · 0 comments
Open

Implement the Maintainability Index Code Metric #4657

Vogel612 opened this issue Dec 18, 2018 · 0 comments
Assignees
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

Comments

@Vogel612
Copy link
Member

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:

(171 - 5.2 * ln(HV) - 0.23 * CC - 16.2 * ln(LoC))*100 / 171

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.

@Vogel612 Vogel612 added enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. up-for-grabs Use this label in conjunction with a difficulty level label, e.g. difficulty-02-ducky difficulty-02-ducky Resolving these involves the internal API, but with relatively easy problems to solve. feature-code-metrics labels Dec 18, 2018
@Vogel612 Vogel612 self-assigned this Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

1 participant