Metric-OO.LCOM4

Lack of cohesion in methods

Required inputs: RFG

Counts the number of disjoint method and field clusters in each class. A cluster consists of all methods calling each other as well as all fields referenced by these methods. Does not include constructors and destructors.

Alternative version of Metric-OO.LCOM based on the definition by Hitz and Montazeri.

Possible Messages

This rule has no predefined messages.

Options

display_name

display_name : str | None = 'Lack of cohesion in methods'

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.
 

ignore_interface_classes

ignore_interface_classes : bool = False

Do not calculate metric for classes marked as interfaces. Classes without data members and only pure virtual methods, except static methods and constructors, are considered interfaces.
 

max_value

max_value : int | None = 1

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.OO.LCOM4'

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