Analyze duplicates

Last modified: 16 December 2024

IntelliJ IDEA helps you find repetitive blocks of code in a certain set of files by means of the Duplicated code fragment inspection. If you create a duplicate by writing or pasting code, IntelliJ IDEA highlights it right away and suggests quick-fixes.

The inspection works out of the box and has a number of settings that you can change to adjust its behavior.

To see all duplicates in the selected set of files at once, run the inspection by name.

https://resources.jetbrains.com/help/img/idea/2024.3/ij_dup2.png
Gif