Function write_clone_coupling_sarif
pub fn write_clone_coupling_sarif<W: Write>(
rows: &[CloneCouplingRow],
repo_root: &str,
w: &mut W,
) -> Result<()>Expand description
Emit a SARIF 2.1.0 document for live clone-coupling findings.
Schema per the research brief:
- One SARIF
resultper (clone_group_id,file_a,file_b) pair. locations[0]= higher-support_apartner (the more-frequently-changed file);locations[1]= lower partner. Matches GitHub Code Scanning’s “first location is primary” rendering convention.partialFingerprintskeys:cloneGroupFingerprint/v1(AST digest) +filePairHash/v1(sha256of sorted file pair).properties.security-severityderived fromcombined_score * 10(0-10 scale per SARIF spec §3.27.17). Live clones get higher severity than the bare CODELORE-CLONE rule because the co-change signal proves this is real debt, not dead lookalike code.