Metric-OO.WMC.One

Weighted Methods per Class based on 1

Required inputs: RFG

Sum over all weighted defined or overridden methods of a class (template, interface) where 1 is used as weight. Inherited methods are not counted.

Possible Messages

This rule has no predefined messages.

Options

display_name

display_name : str | None = 'Weighted Methods per Class based on 1'

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

ignore_artificial_methods

ignore_artificial_methods : bool = True

Do not count artificial methods.
 

ignore_deleted_methods

ignore_deleted_methods : bool = True

Do not count deleted methods.
 

include_interfaces

include_interfaces : bool = True

Compute WMC also for interfaces. Pure virtual abstract C++ classes are not regarded as of type Interface. Interfaces can occur in C++/CLI or C# code.
 

include_templates

include_templates : bool = True

Compute WMC also for templates.
 

max_value

max_value : float | None = 20.0

Maximum allowed value. None if unlimited.
 

min_value

min_value : float | None = 0.0

Minimum allowed value. None if unlimited.
 

rfg_metric_name

rfg_metric_name : str = 'Metric.OO.WMC.One'

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

weight_attribute

weight_attribute : str | None = None

RFG node attribute used as weight for the method. If None, a weight of 1 is used for every method.