PMD is an Open Source, rule based, static source code analyzed that analyzes java source code based on the evaluative rules that have been enabled during given execuetion. The tool comes with a default set of rules which can be used to unearth, common development mistakes such as having emty try catch blocks, variables , that never used, objects that are unecessary etc.
Regardless of how experienced and talented programmer may be, he/she is likely to make mistakes while writing programs. Unfortunatly while for smaller program these mistakes are usually few and offen have limited infact only. As program grow, even small mistakes start having unexpectedly severe impact.
Duplicate code can be hard to find, especially in a large project. But PMD's Copy/Paste Detector (CPD) can find it for you!
CPD will not identify duplicates based on the logic and will identify based on the String which are matichig. For suppose if we have same logic with different variable will not identify as vioaltion by CPD.
Note that CPD works with Java, JSP, C, C++, Fortran and PHP code. CPD is included with PMD