You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can read up on the concept of code cohesion here.
Basically, it measures how well a class is structured as a logical unit. This tool tells you what percentage of instance variables a class method uses. So if class Cls has instance variables self.instance1 and self.instance2, and member function func only uses self.instance1 then it will get 1/2 or 50% cohesion:
The rationale being that classes with member functions that use a large percentage of the instance variables available have strongly related functionality. Classes that have many instances variables that only get used in a few places would probably be better suited as multiple, different classes.
High cohesion is when you have a class that does a well defined job. Low cohesion is when a class does a lot of jobs that don't have much in common.
I ran the lib cohesion over my code and return me the result.. what the lib analyze ?
The text was updated successfully, but these errors were encountered: