Purpose

Some violations are missing for this QR.

Applicable in CAST Version
Release
Yes/No
8.3.x(tick)
Applicable RDBMS
RDBMS
Yes/No
CSS(tick)
Action Plan

Class A  in file xyz.cs violating the rule Avoid classes of high lack of Cohesion

If you have only constants fields in your class: m=0, a=0, m(Aj)= 0 for all attributes.

a= 0 as contant fields are not considered in the count of class data member.

Here are the results, when applying the computation on the provided Class A: m=0, a=0, m(Aj)= 0 for all attributes Hence: LCOM = [1/0 x 0 - 0 ] / [1] => division by 0 => LCOM set to 1. Hence the class is listed as violating the rule.

Since the class is only containing static fields, a simple remidiation is to

  1. Replace the class by an enum
Notes/comments
 Refer to LCOM calculation