Skip to main content

run_clone_coupling

Function run_clone_coupling 

pub fn run_clone_coupling(
    db: &FactsDb,
    opts: &Options,
) -> Result<Vec<CloneCouplingRow>>
Expand description

Run the clone-coupling analysis. Returns rows sorted by combined_score descending.

Performance: the JOIN is O(n × k²) where n is the number of clone families and k is the average family size (typically ≤ 10). With a HashMap-based probe table built from coupling results, the inner loop is O(k²) per family rather than O(pairs²) across the whole repo — follows the SourcererCC index-then-probe pattern from the research brief.