Find duplicate code with jscpd
jscpd is a great tool for finding duplicate pieces of JavaScript (and not only) code. A sample config looks like:
exclude:
- "**/node_modules/**"
files:
- "**/*.js"
min-lines: 8
min-tokens: 80
output: "cpd.xml"
Now running just jscpd
will generate cpd.xml
. It’s in the CPD format, which makes it a great fit for the DRY plugin in Jenkins.