Skip to content

ALL-DUPL0004 · evidence

This page continues ALL-DUPL0004 directly from its source docstring. Read its implementation.

The finding names where the group was first stated, how many lines it repeats, and how many lines the whole tree holds, and the value is the share of the tree those repeated lines occupy. The denominator is every line of every file the kernel read, including blank ones, which is the same denominator Symilar divides by.

A clone group always names at least two nonoverlapping fragments in a nonempty repository. Those conditions are fact constraints rather than fallback arithmetic in this rule. The repository’s Git ignore files decide whether generated and vendored trees are read, so a checked-in build directory counts unless the repository excludes it. A copy that is deliberate, such as a test double that mirrors the shape it stands in for, still counts here, because this rule measures the tree rather than judging the intent behind it.

  • Generalizes Pylint R0801 duplicate-code
  • Cites “Clean Code”, chapter 17, on duplication as the primary enemy of design
  • Cites “Working Effectively with Legacy Code”, chapter 20, on extraction