CQM-DeadRoutines¶
Counts the number of dead routines
Counts and reports the number of violations for each rule listed in counted_rules as system metrics. The values of this metric are not stored in the RFG and violations cannot be suppressed/justified.Note: The Option Results.Dashboard.advanced.import_only_first_style_violation_per_line can affect the results of this metric, since the violations already counted by this metric could be removed before being imported into the database and subsequently the dashboard and plugins.
Motivation
By means of private routines it is possible to implement higher-level services that are provided from the class to the outside. For this the private routines are called by the services directly or indirectly through other routines.
Private routines that are not used by services or other routines are therefore superfluous and only increase the size of the class.
The considered visibility is limited to private, because only in
this case a later (external) use can be ruled out with high probability.
This rule is based on the CQM Quality Indicator: tote Methoden (p. 297-299).
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: severity
This rule shares the following common metric options: report_all_values
The following places define options that affect this rule: Analysis-GlobalOptions
append_error_number_to_metric_name¶
append_error_number_to_metric_name : bool = False
append_rule_names_to_metric_name¶
append_rule_names_to_metric_name : bool = False
counted_rules (if present at
the rule) should be appended to the metric name.
count_suppressed_issues¶
count_suppressed_issues : bool = False
counted_rules¶
counted_rules : set[bauhaus.analysis.config.GlobPattern] = {'DeadCodeDetection'}
display_name¶
display_name : str | None = 'Number of dead routines. '
counted_rules (if present at the rule) appended to it, if
sum_up_violations is false.
If unset, metric_name is used.
max_value¶
max_value : int = 0
metric_name¶
metric_name : str = 'Metric-Dead.Routines'
counted_rules (if present at the rule)
added at the end.
min_value¶
min_value : int = 0
sum_up_violations¶
sum_up_violations : bool = False