Copy / Paste Detection
Sonar enables to search and report on Copy / Paste of source code. To do this, Sonar can rely on PMD CPD or Sonar CPD.
For more information on duplication, see the Manage Duplicated Code with Sonar blog post.
This is the historical engine to search for copy / paste. Mainly for performances reasons, it only enables to do copy / paste detection within a project and event within a maven module when maven is used.
Since Sonar 2.11, a new Sonar copy paste detection engine has been added that is much more scalable and can detect cross-projects duplications. The switch between the 2 engines can be parameterized, the default being Sonar.
The reporting of duplication is done at all level. When looking at a file, it is possible to see the blocks of duplicated code that have been found.