Class LCOM4

LCOM4 (Hitz & Montazeri, 1995)

Formula: LCOM4 = number of connected components in the method-field graph

Where:

  • A connected component is a maximal set of methods connected through shared fields
  • Methods are connected if they access the same field or are transitively connected

Returns a value >= 1:

  • 1: perfect cohesion (all methods are connected)
  • Higher values: increasing lack of cohesion

Implements

Constructors

Properties

Methods

Constructors

Properties

name: string = 'LCOM4'
description: string = 'Lack of Cohesion of Methods (Hitz & Montazeri, 1995) - Number of connected components'

Methods