Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.12
-
Component/s: Administration, Duplications
-
Labels:None
-
Environment:all
-
Number of attachments :
Description
Add these two options to the CPD options in Configuration->Settings->CPD
ignoreLiterals
if true, CPD ignores literal value differences when evaluating a duplicate block. This means that foo=42; and foo=43; will be seen as equivalent. You may want to run PMD with this option off to start with and then switch it on to see what it turns up; defaults to false.
ignoreIdentifiers
Similar to ignoreLiterals but for identifiers; i.e., variable names, methods names, and so forth; defaults to false.
see http://pmd.sourceforge.net/cpd.html and there "Ant Task".
Default values to be defined. For a first try, both false as defined by PMD-CPD ahould be OK.
Default true maybe shows up too many duplicates for some projects.
Those two options must be specified when creating the JavaLanguage object and are used internally by the JavaTokenizer object. I confirm that the default values are false.
The following piece of code must be added :