Metric-MIPerRoutine

MaintainabilityIndex

Required inputs: RFG

Measures the general maintainability of code based on the Halstead Volume (HV), McCabe Complexity (MC) lines of code (LOC) and comment lines (COM) metrics and is calculated as:

171 - 5.2 * ln(HV) - 0.23 * MC - 16.2 * ln(LOC) + 50 * sin(sqrt(2.4 * (COM / LOC)))

Lower values represent a higher maintainability demand.

Possible Messages

This rule has no predefined messages.

Options

display_name

display_name : str | None = None

Description of the metric shown in the dashboard. If None, rfg_metric_name is used.
 

max_value

max_value : float | None = None

Maximum allowed value. None if unlimited.
 

min_value

min_value : float | None = None

Minimum allowed value. None if unlimited.
 

rfg_metric_name

rfg_metric_name : str = 'Metric.MI_Per_Routine'

Name of the node attribute storing the metric value in the RFG.
 

system_node_metric_name

system_node_metric_name : str = 'Metric.MI'

Name of the node attribute storing the maintainability index in the system node.