duplication/jscpd
Reports every block of code copied between files, naming both places.
Part of the duplication configuration, at the all level. It runs at the push stage, once per scope. It runs jscpd.
A fix in one place leaves the copied block broken in the other.
What to do
Section titled “What to do”Move the shared block into one function both callers use.
Example
Section titled “Example”Two files with the same long block of code report that block. Move it into one function, and call it from both places.
Turn it off
Section titled “Turn it off”Turn it off for some files, with a reason:
gspot ignore duplication/jscpd --paths "<glob>" --reason "<why>"