Skip to content

v1.0.0 - Initial release

Latest

Choose a tag to compare

@astubbs astubbs released this 16 Apr 05:12
· 7 commits to main since this release
d3140ef

Initial release of Duplicate Code Cross-Check.

What it does

Detects duplicate code on pull requests using two complementary engines:

  • PMD CPD - deep language awareness for Java, Kotlin, C++, Python, Go, and more
  • jscpd - language-agnostic token matching as a second perspective

Runs both on the PR branch and the base branch, compares the results, and posts a single unified PR comment with the delta. Fails the build if either engine reports a regression.

Features

  • Single combined PR comment with side-by-side engine results
  • Base-vs-PR comparison - shows what the PR introduced, not just total duplication
  • Inline PR review comments on specific lines of new duplication
  • Content-hash matching of clones so refactors that shift line numbers don't cause false positives
  • Per-engine configurable thresholds (absolute ceiling + increase-vs-base)
  • Emoji reactions on deltas based on magnitude

Why

Agentic programming makes duplicate code a much bigger problem. LLM-based agents tend to copy patterns they've already seen in the codebase rather than refactor to reuse them. Nothing in the GitHub Marketplace does base-vs-PR comparison for duplicate detection, so we built it.

See the README for full usage docs and comparison with related tools.

Usage

- uses: astubbs/duplicate-code-cross-check@v1
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    directories: src