scitools.com

← Metric catalog

Percent Lack Of Cohesion is one of the source-code metrics Understand computes across 17+ languages — browse them in the GUI, export and track them, or script them with the Python API.

Percent Lack Of Cohesion

API ID: PercentLackOfCohesion
Also Known As: LCOM2, Lack of Cohesion in Methods (LCOM/LOCM)
Languages: Ada, Basic, C#, C++, Java, Pascal
Targets: Classes, Packages

100% minus the average cohesion for package entities.

100% minus average cohesion for class data members. Calculates what percentage of class methods use a given class instance variable. To calculate, average percentages for all of that class's instance variables and subtract from 100%. A lower percentage means higher cohesion between class data and methods.

Also known as Chidamber & Kemerer - Lack of Cohesion in Methods (LCOM/LOCM); LCOM2.


Targets By Language: Configuration: