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

alias_name

alias_name : str = 'Metric.LongParameterList'

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 = 'Number of Parameters'

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

max_value

max_value : int | None = 7

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

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