Awesome Reviewers checks + prompts

Duplicate code detection

Finds copied blocks so a fix in one copy is not missed in the others, and flags new code that re-implements an existing helper.

V1011 technique
tactic Static analysis
not detectable from CI configuration

Sub-techniques

2

IDNameDescription
V1011.001Token clone detectionReport token-identical or near-identical blocks above a size threshold.
V1011.002Semantic reuse checkSearch the codebase for an existing function that does what the new code does, by embedding or by name.

Craft it

  1. Run a clone detector with a minimum token count that ignores tests and generated code.
  2. Report only clones introduced by the change.
  3. For reuse, index function signatures and docstrings and query with each new function.

Reverse engineer it

Signs that a codebase already runs this technique, and where to read how it is configured.

  • .jscpd.json or a cpd task in the build.
  • Review comments asking to reuse an existing helper point at where this is missing.

Open-source packages

3