diff --git a/pmd/xdocs/cpd.xml b/pmd/xdocs/cpd.xml index cfee78f22e..a87d2951b0 100644 --- a/pmd/xdocs/cpd.xml +++ b/pmd/xdocs/cpd.xml @@ -45,16 +45,51 @@ ]]> -

There's a ignoreLiterals="true" option which makes CPD ignore literal + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
encodingThe character set encoding (e.g., UTF-8) to use when reading the source code files; defaults to locale setting.No
formatThe format of the report (e.g. csv, text, xml); defaults to text.No
ignoreLiteralsif 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. There's also a ignoreIdentifiers="true" option - that does the same thing with identifiers; i.e., variable names, methods names, and so forth. - The same guidelines apply. There's also an encoding option which allows the encoding used - when parsing files to be specified; the default is based upon the locale. - Finally, there's an optional language="cpp|java|php|ruby" flag - to select the appropriate language; the default language is "java". -

+ then switch it on to see what it turns up; defaults to false.
No
ignoreIdentifiersSimilar to ignoreLiterals but for identifiers; i.e., variable names, methods names, and so forth; defaults to false.No
languageFlag to select the appropriate language (e.g. cpp, java, php, ruby); defaults to java.No
minimumtokencountA positive integer indicating the minimum duplicate size.Yes
outputfileThe destination file for the report. If not specified the console will be used instead.No

Also, you can get verbose output from this task by running ant with the -v flag; i.e.:

ant -v -f mybuildfile.xml cpd @@ -77,7 +112,7 @@ $ java net.sourceforge.pmd.cpd.CPD --minimum-tokens 100 --files /usr/local/java/ $ java net.sourceforge.pmd.cpd.CPD --minimum-tokens 100 --files /path/to/c/source --language cpp -

You may wish to check sources that are stored in differents directories:

+

You may wish to check sources that are stored in different directories:

$ java net.sourceforge.pmd.cpd.CPD --minimum-tokens 100 --files /path/to/other/source --files /path/to/other/source --files /path/to/other/source --language fortran