Class LCOM1

LCOM1 (Chidamber & Kemerer, 1991)

Formula: LCOM1 = |P| - |Q|, where P > Q, otherwise 0

Where:

  • P is the set of method pairs that do not share instance variables
  • Q is the set of method pairs that share at least one instance variable
  • If P <= Q, then LCOM1 = 0

Returns a value >= 0:

  • 0: good cohesion
  • Higher values: lack of cohesion

Implements

Constructors

Properties

Methods

Constructors

Properties

name: string = 'LCOM1'
description: string = 'Lack of Cohesion of Methods (Chidamber & Kemerer, 1991) - Difference between non-sharing and sharing method pairs'

Methods