Classic maintanability index
The maintanability index represents the relative ease of maintaining the code.
This model consists of a number of easily calculated metrics, and is able to easily and quickly predict the maintainability of a software product.
The maintainability index is given as a polynomial equation composed of predictor variables. Through a series of studies it has been shown that there is a strong correlation between software maintainability and predictor variables such as McCabe's Cyclomatic Complexity, Halstead Volume and Number of Lines of Code.
Method of calculation
The equation to obtain the maintainability index is:
CMI = 171 – 5.2 * ln(V) – 0.23 * CC – 16.2 * ln(LoC)
V is the Halstead volume
CC is the cyclomatic complexity
LoC is the lines of code