CQM-LabyrinthRoutine

Routine Complexity

Required inputs: RFG

Any routine with a higher cyclomatic complexity (McCabe) than 10 is a violation of this metric.

Motivation

The more branches the control flow of a routine contains, the more difficult it is to understand, test and further develop a routine. Routines with a high control flow complexity are also more error-prone than other routines due to the high number of control flow paths that make them difficult to understand. Likewise, a complete test of the routine becomes more costly and ultimately less likely.

This rule is based on the CQM Quality Indicator: Labyrinthmethode (p. 237-239).

Reference

Simon, Frank/ Seng, Olaf/ Mohaupt, Thomas (2006): Code-Quality-Management: Technische Qualität industrieller Softwaresysteme transparent und vergleichbar gemacht, 1st ed., Heidelberg, Germany: dpunkt.verlag GmbH.

Possible Messages

This rule has no predefined messages.

Options

alias_name

alias_name : str = 'Metric.LabyrinthRoutine'

Name under which the metric will be reported. In the RFG, a metric with this value is created, too (copied from original metric).
 

display_name

display_name : str | None = 'Routine Complexity'

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

max_value

max_value : int | None = 10

Maximum allowed value. None if unlimited.
 

min_value

min_value : int | None = 0

Minimum allowed value. None if unlimited.
 

rfg_metric_name

rfg_metric_name : str = 'Metric.McCabe_Complexity'

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