Skip to content

Related Tools

Tool Approach Notes
dupl Suffix tree The original tool art-dupl is forked from
golangci/dupl Suffix tree golangci-lint’s fork of dupl
go-tools Static analysis Comprehensive Go static analysis (not clone-specific)
Tool Approach Notes
jscpd Token-based Multi-language, not AST-aware
PMD CPD Token-based Java-focused, supports other languages
Sourcerer AST-based Commercial, multi-language

art-dupl combines:

  • AST-level analysis (not text/token-based) — understands Go semantics
  • Suffix tree algorithm — O(n) duplicate search with O(1) transitions
  • Three matching modes — semantic, exact, structural
  • Generated-code filtering — auto-detects 6 generator categories
  • CI baseline gating — record accepted state, gate on new clones
  • Templ support — full .templ AST analysis
  • 7 output formats — including SARIF for GitHub Security
  • Programmatic SDK — embed in your own tools

art-dupl is not currently integrated with golangci-lint. To use alongside it:

Terminal window
# Run golangci-lint for linting
golangci-lint run
# Run art-dupl for clone detection separately
art-dupl -t 15

Or use the pre-commit hook to run art-dupl automatically.