CQM-GodRoutine

Lines of Code in a Routine (Empty, Comment, Code)

Required inputs: RFG

Any routine containing more than 200 gross lines of source code is a violation of this metric.

Motivation

Readability and comprehensibility have a significant impact on the maintainability of code. Only code that is understood can be modified efficiently. If a routine extends over several pages (on the screen or on paper), readability and comprehensibility are severely limited by the sheer length of the routine. A god routine differs from a »labyrinth routine« in that the latter has a complex control flow, but it does not necessarily have to be very long.

This rule is based on the CQM Quality Indicator: Gottmethode (p. 201-203).

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.GodRoutine'

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 = 'Lines of Code in a Routine (Empty, Comment, Code)'

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

max_value

max_value : int | None = 200

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.Lines.Routine.LOC'

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