Skip to main content

Module hk

Module hk 

Source
Expand description

Coupling counts over flow edges. For each internal (non-external) node we count unique flow partners (fan_in / fan_out) and track outgoing edges to external libraries separately (fan_out_external). Results are written into node attrs as flat keys; zero values are omitted. The size-folding Henry–Kafura metric (hk = sloc · (fan_in · fan_out)²) is no longer computed here — it is a graph-derived [fields.hk] CEL formula evaluated by builtin::write_derived once these counts are on the node.

Functions§

annotate_coupling
Annotate fan_in / fan_out / fan_out_external on every internal node, counting only flow edges. External nodes carry no coupling metrics.