Hacker News new | ask | show | jobs
by playingalong 677 days ago
Can I use it to detect Copy & Paste within my company's own codebase?
3 comments

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.

[1] https://pmd.github.io/pmd/pmd_userdocs_cpd.html

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?