CQM-LongParameterList¶
Number of Parameters
Required inputs: RFG
Any routine with more than 7 parameters is a violation of this metric.
Motivation
Routines/ Structors with very many parameters are difficult to use, to understand and very susceptible to change. While in not object-oriented languages the only alternative to routine parameters is global data, with objects, it is now possibility for routines to retrieve the necessary information from a passed object themselves.
This rule is based on the CQM Quality Indicator: Lange Parameterliste (p. 240-242).
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.LongParameterList'
display_name¶
display_name : str | None = 'Number of Parameters'
max_value¶
max_value : int | None = 7
min_value¶
min_value : int | None = 0
rfg_metric_name¶
rfg_metric_name : str = 'Metric.Number_Of_Parameters'