Jetbrains IDEs will flag duplicate code of N lines (configurable) or more. Just run the inspection manually and there you go. You can even do it in batch in CI nowadays.
I've had some success with PMD/CMD [1]. It's Java-based, though, which could be a pain, depending on your setup. If your codebase uses Python, you can use Pylint for this, too.
What do you need that for? It’s not really cheating when it’s going into a product, if it works it works. In a hypothetical ideal corporate environment wouldn’t it be preferred if one could save company time by copy and pasting?