object

# coupling_metric

> Computes entity efferent coupling, afferent coupling, and instability.

author:
  `Ebrahim Azarisooreh and Paulo Moura`
version:
  `0.9`
date:
  `2018/3/21`

compilation flags:
  `static, context_switching_calls`

imports:
  `public code_metrics_utilities`
  `public code_metric`

## Public interface

(see related entities)

## Protected interface

(see related entities)

## Private predicates

(see related entities)

## Operators

### (none)

## Remarks

Efferent coupling (Ce)
  Number of entities that an entity depends on.

Afferent coupling (Ca)
  Number of entities that depend on an entity.

Instability (I)
  Computed as Ce / (Ce + Ca). Measures the entity resilience to change. Ranging from 0 to 1, with 0 indicating a maximally stable entity and 1 indicating a maximally unstable entity. Ideally, an entity is either maximally stable or maximally unstable.

Abstractness (A)
  Computed as the ratio between the number of static predicates with scope directives without and a local definition and the total number of static predicates with scope directives. Measures the rigidity of an entity. Ranging from 0 to 1, with 0 indicating a fully concrete entity and 1 indicating a fully abstract entity.

Entity score
  Represented as the compound term ce_ca_i_a(Ce,Ca,I,A).

Dependencies count
  Includes direct entity relations plus calls or dynamic updates to predicates in external objects or categories.

## See also

### (none)