Maintainability Index

Ani picture Ani · Feb 27, 2009 · Viewed 7.1k times · Source

I have come across the recommended values for a Maintainability Index (MI) as follows:

  • 85 and more: good maintainability
  • 65-85: moderate maintainability
  • 65 and below: difficult to maintain with really bad pieces of code (big, uncommented, unstructured) the MI value can be even negative

Are these values are dependent on technology? For example, is a value of 70 good for Mainframes but difficult to maintain for Java?

Can use same yardstick independent of technologies?

Answer

Anton K picture Anton K · Dec 7, 2009

This is an explanation about meaning of maintainability index value.

Shortly this is

MI = 171 - 5.2*ln(Halstead Volume) - 0.23*(Cyclomatic Complexity) - 16.2*ln(Lines of Code)

scaled between 0 and 100.

As it's easy to see, this metric can be used for any procedural language.