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¶
This rule shares the following common options: exclude_messages_in_system_headers, excludes, includes, justification_checker, post_processing, provider, severity
This rule shares the following common metric options: base_view_name, excluded_node_types, hierarchy_edge_name, hierarchy_view_name, propagate, report_all_values, report_propagated_values
The following places define options that affect this rule: Analysis-GlobalOptions
alias_name¶
alias_name : str = 'Metric.GodRoutine'
display_name¶
display_name : str | None = 'Lines of Code in a Routine (Empty, Comment, Code)'
max_value¶
max_value : int | None = 200
min_value¶
min_value : int | None = 0
rfg_metric_name¶
rfg_metric_name : str = 'Metric.Lines.Routine.LOC'