Skip to main content

compute_coupling_score

Function compute_coupling_score 

Source
pub fn compute_coupling_score(
    a_to_b: u32,
    b_to_a: u32,
    funcs_a: u32,
    funcs_b: u32,
) -> f64
Expand description

Compute coupling score between two modules.

The score is computed as: cross_calls / (total_functions * 2)

Where:

  • cross_calls = calls from A to B + calls from B to A
  • total_functions = functions in A + functions in B

The score is clamped to [0.0, 1.0].