I’ve recently found a useful tool to help with refactoring horrible code that has been suffering from a bad case of copy and paste coding.
The software is called Atomiq, it allows you to find duplicate code in a project directory and supports a wide range of languages.