This is definitely useful, but.. 😏
Sometimes is duplication much better than bad abstraction.
Duplicated 2 times? It's okey.
More than 3-4 times, let's find out if it could be refactored.
Problem: Your code base probably contains a lot of copy/pasted code, but it's hard to find.
Solution: jscpd
jscpd is a command line tool that finds copy/pasted code and reports specific duplicated lines.
Works for over 150 languages.
Example report: