Awesome Reviewers

Verification · Static analysis

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.

Sub-techniques

  • Token clone detection V1011.001

    Report token-identical or near-identical blocks above a size threshold.

  • Semantic reuse check V1011.002

    Search the codebase for an existing function that does what the new code does, by embedding or by name.

How to build 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.

Signals in a repository

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