Is it possible to disable duplicate code detection in Intellij?
I haven't found this feature to be useful and it continues to distract me.
Is it possible to disable duplicate code detection in Intellij?
I haven't found this feature to be useful and it continues to distract me.
To toggle it, go to Other Settings → Editor → Inspections → General → Duplicated Code.
You can use search field there to find the specific item.
Add a hint to your code so that others will know your intent:
@SuppressWarnings("Duplicates")
Yes, it's possible, but I would strongly advise against it!
Duplicate code is a form of technical debt. Any duplicated code that contains a bug means you now have a duplicated bug - you then run the risk that when you fix it, you'll only fix it in one place and the duplicate will remain...
If duplicate code warnings are distracting you, then the best strategy for getting rid of them is to remove the code duplication... Your codebase and future maintainers will thank you for it
Java has this annotation You should use that instead of turning off the highlight function of IntelliJ Add this line above your class or pieces of code
@SuppressWarnings("Duplicates")