Skip to content
Fallow home
All docs pages

Docs home

Diverged clone siblings

What a diverged-clone-sibling finding of fallow audit means, why it matters and how to fix it.

What it reports

The change edits one copy of duplicated code but not its siblings.

Changed code explains how fallow finds it.

Why it matters

fallow audit reports a base clone group where the change edited exactly one copy, the edit broke the clone, and every other copy kept its text. The siblings can need the same change. A cosmetic edit that keeps the clone, a removed copy, a change that edits every copy, and an edit to a test or story copy do not report. Needs the base snapshot of --gate new-only. Opt-in: defaults to off, because copies often differ on purpose, for example an input and an output type, or a legacy copy. Set it to warn or error to review every diverged copy.

Example

src/a/total.ts and src/b/total.ts held the same function. The change fixes a bug in the first copy only.

Fix

Check the unchanged copies in related. Apply the same change there, or extract a shared function. If the copies must differ, suppress with // fallow-ignore-next-line diverged-clone-sibling.

Facts

FactValue
Issue typediverged-clone-sibling
Rule id in SARIF outputfallow/diverged-clone-sibling
Commandfallow audit
Default severityoff
Config key in rulesdiverged-clone-sibling
Suppression comment// fallow-ignore-next-line diverged-clone-sibling
Fixable with fallow fixNo
Opt-inYes