Search code examples
javascriptcode-duplication

jsinspect to find similar code in multiple files


I want to detect duplicate code by comparing multiple files. I have tried jsinpsect but it find similar code only file by file. It reports me only if a code block exist multiple times in same file.

Is there any option so that I can get the comparison like

- Find duplicate in FileA
- Then compare FileA in the remaining /src folder
- Find duplicate in FileB
- Then compare File in the remaining /src folder
.. so on

Solution

  • I use https://www.npmjs.com/package/jscpd. It's great tool to find duplicated blocks.