Skip to content

Commit

Permalink
34422: Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
brouwers-tiobe committed Nov 1, 2024
1 parent e15bffe commit d0ba624
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions docs/pages/pmd/userdocs/cpd/cpd.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ refactored out. We thus advise developers to use CPD to **help remove duplicates

### Refactoring duplicates

Once you have located some duplicates, several refactoring strategies may apply depending of the scope and extent of
Once you have located some duplicates, several refactoring strategies may apply depending on the scope and extent of
the duplication. Here's a quick summary:

* If the duplication is local to a method or single class:
Expand Down Expand Up @@ -180,9 +180,11 @@ exactly identical.
By default, annotations are not ignored."
languages="C#, Java"
%}
{% include custom/cli_option_row.html options="--ignore-sequences"
description="Ignore sequences of identifier and literals.
By default, such sequences are not ignored."
{% include custom/cli_option_row.html options="--ignore-sequences"
option_arg="type"
description="Ignore sequences. Types of sequences ignored can be specified in `type`
(if no parameter is provided, defaults to `literals-identifiers`).
See available options [here](#sequence-exclusion)."
languages="C++"
%}
{% include custom/cli_option_row.html options="--ignore-usings"
Expand Down Expand Up @@ -357,6 +359,14 @@ to be "debug".

For details, see [CPD Report Formats](pmd_userdocs_cpd_report_formats.html).

## Sequence exclusion

Several strategies are available for the exclusion of lists from being marked as duplicates:

* `literals-identifiers` (Default) skip lists containing literals and identifiers.
* `literals` skip lists containing only literal elements. This is equivalent to `--ignore-literal-sequences`.
* `initializations` skip all list initializations, regardless of their content.

## Ant task

Andy Glover wrote an Ant task for CPD; here's how to use it:
Expand Down

0 comments on commit d0ba624

Please sign in to comment.