Is there any tool to detect code duplication in JavaScript? I tried "PMD Duplicate code detector" but it is not supporting .js extension.
I would recommend JSCPD
npm install -g jscpd
jscpd ./path/to/code
(you have several type of reporters, default is console, but you can use html like this: jscpd -r html ./path/to/code
)
Other solutions:
You can use JS Inspect it detects copy-pasted and structurally similar code, also supports *.js
npm install -g jsinspect
jsinspect -t 50 ./path/to/src
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With