Question

I have been browsing through the posts and the MSDN, but I am not seeing how the Maintainability Index is created. Only what the good and bad values are.

http://msdn.microsoft.com/en-us/library/bb385914.aspx

Does anyone know? Can we get a reference or explination as to what they are using?

I am interested in what is defined as easy to maintain code. Also more detail on the other metrics would be welcome, but as extra credit. The explination for the other metrics is much more understandable.

Was it helpful?

Solution

There is an explanation on the blog of their Code Analysis Team.

The actual formula for it is:

Maintainability Index = MAX(0,(171 - 5.2 * ln(Halstead Volume) 
    - 0.23 * (Cyclomatic Complexity) 
    - 16.2 * ln(Lines of Code))*100 / 171)

But don't just listen to me, go get the full read there.

OTHER TIPS

The history of the maintainability index goes back to 1992, and was included in Visual Studio in 2007.

Since then, several papers have appeared critically discussing the index, the coefficient, the metrics it is composed of, and the difficulty of using it in practice.

For a summary, you can checkout my blog post "Think Twice Before Using the Maintainability Index."

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top