Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
67 lines (46 sloc) 2.7 KB
Root.Smell.Complexity.MaintainabilityIndex Parent Index
Sibling aspects CylomaticComplexity

MaintainabilityIndex

Software metric which measure how maintainable is a program.

The maintainablity index is always in the range 0-100 and is ranked as follow:

  • A MI in the range 0-9 maps to a code extremely difficult to maintain.
  • A MI in the range 10-19 maps to a maintainable code.
  • A MI in the range 20-100 maps to a code highly maintainable.

Tastes

* bold denotes default value

Subaspects

This aspect does not have any sub aspects.

Example

'''
The maintainability index for the following piece of code is 100.
'''
def preorder(node):
    if tree:
        print(node.key)
        preorder(node.left)
        preorder(node.right)

Importance

Complex codes are difficult to maintain.

How to fix this

This can be solved by writing simpler functions and methods.