public class CpdTask extends org.gradle.api.tasks.SourceTask implements ReportingEntity<CpdReports>
| Constructor and Description |
|---|
CpdTask() |
| Modifier and Type | Method and Description |
|---|---|
org.gradle.api.file.FileCollection |
getCpdClasspath()
Get the classpath containing the CPD classes used by the task.
|
java.lang.String |
getEncoding()
Get the encoding used by CPD to read the source files and to produce the report.
|
java.lang.String |
getLanguage()
Get the language of the source files to analyze, e.g.
|
int |
getMinimumTokenCount()
The minimum duplicate size to be reported.
|
CpdReports |
getReports()
Get the reports produced by this task.
|
java.lang.String |
getSkipBlocksPattern()
Specifies the pattern to find the blocks to skip when
skipBlocks is true. |
org.gradle.api.file.FileTree |
getSource() |
java.lang.String |
getToolVersion()
Get the version of CPD to use.
|
boolean |
isIgnoreAnnotations()
If true, annotations will be ignored.
|
boolean |
isIgnoreIdentifiers()
If true, differences in identifiers (like variable names or methods names) will be ignored
in the same way as literals in
isIgnoreLiterals(). |
boolean |
isIgnoreLiterals()
If true, CPD ignores literal value differences when evaluating a duplicate block.
|
boolean |
isIgnoreUsings()
If true, using directives in C# will be ignored when comparing text.
|
boolean |
isSkipBlocks()
If true, skipping of blocks is enabled with the patterns specified in the
skipBlocksPattern property. |
boolean |
isSkipDuplicateFiles()
If true, CPD will ignore multiple copies of files with the same name and length.
|
boolean |
isSkipLexicalErrors()
If true, CPD will skip files which can't be tokenized due to invalid characters instead of
aborting the analysis.
|
CpdReports |
reports(org.gradle.api.Action<? super CpdReports> pAction)
Configure this task's reports.
|
CpdReports |
reports(groovy.lang.Closure pClosure)
Configure this task's reports.
|
void |
run()
Perform copy-paste detection on the sources and produces the enabled report(s).
|
void |
setCpdClasspath(org.gradle.api.file.FileCollection pCpdClasspath) |
void |
setEncoding(java.lang.String pEncoding) |
void |
setIgnoreAnnotations(boolean pIgnoreAnnotations) |
void |
setIgnoreIdentifiers(boolean pIgnoreIdentifiers) |
void |
setIgnoreLiterals(boolean pIgnoreLiterals) |
void |
setIgnoreUsings(boolean pIgnoreUsings) |
void |
setLanguage(java.lang.String pLanguage) |
void |
setMinimumTokenCount(int pMinimumTokenCount) |
void |
setSkipBlocks(boolean pSkipBlocks) |
void |
setSkipBlocksPattern(java.lang.String pSkipBlocksPattern) |
void |
setSkipDuplicateFiles(boolean pSkipDuplicateFiles) |
void |
setSkipLexicalErrors(boolean pSkipLexicalErrors) |
void |
setToolVersion(java.lang.String pToolVersion) |
exclude, exclude, exclude, exclude, getExcludes, getIncludes, getPatternSetFactory, include, include, include, include, setExcludes, setIncludes, setSource, setSource, sourceconventionMapping, conventionMapping, getConventionMappingappendParallelSafeAction, compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getRequiredServices, getServices, getSharedResources, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTaskIdentity, getTemporaryDir, getTemporaryDirFactory, getTimeout, hasProperty, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, replaceLogger, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toString, usesService@InputFiles @SkipWhenEmpty public org.gradle.api.file.FileTree getSource()
getSource in class org.gradle.api.tasks.SourceTask@Input public java.lang.String getToolVersion()
PmdExtension.toolVersion, or, if that extension isn't available, version
"6.16.0".public void setToolVersion(java.lang.String pToolVersion)
@InputFiles public org.gradle.api.file.FileCollection getCpdClasspath()
cpd configuration.public void setCpdClasspath(org.gradle.api.file.FileCollection pCpdClasspath)
public CpdReports getReports()
getReports in interface ReportingEntity<CpdReports>public CpdReports reports(groovy.lang.Closure pClosure)
reports in interface ReportingEntity<CpdReports>pClosure - A closure that configures the reports.public CpdReports reports(org.gradle.api.Action<? super CpdReports> pAction)
reports in interface ReportingEntity<CpdReports>pAction - An action that configures the reports.@Input @Optional public java.lang.String getEncoding()
public void setEncoding(java.lang.String pEncoding)
@Input @Optional public java.lang.String getLanguage()
public void setLanguage(java.lang.String pLanguage)
@Input public int getMinimumTokenCount()
public void setMinimumTokenCount(int pMinimumTokenCount)
@Input public boolean isIgnoreLiterals()
foo=42; and foo=43; will be seen as equivalent. Default is false.public void setIgnoreLiterals(boolean pIgnoreLiterals)
@Input public boolean isIgnoreIdentifiers()
isIgnoreLiterals(). Default is false.public void setIgnoreIdentifiers(boolean pIgnoreIdentifiers)
@Input public boolean isIgnoreAnnotations()
public void setIgnoreAnnotations(boolean pIgnoreAnnotations)
@Input public boolean isSkipDuplicateFiles()
public void setSkipDuplicateFiles(boolean pSkipDuplicateFiles)
@Input public boolean isSkipLexicalErrors()
public void setSkipLexicalErrors(boolean pSkipLexicalErrors)
@Input public boolean isSkipBlocks()
skipBlocksPattern property. Default is false.skipBlocksPattern should be skipped, false if not.public void setSkipBlocks(boolean pSkipBlocks)
@Input @Optional public java.lang.String getSkipBlocksPattern()
skipBlocks is true. The string
value contains two parts, separated by a vertical line ('|'). The first part is the start
pattern, the second part is the end pattern. The default value is "#if 0|#endif".public void setSkipBlocksPattern(java.lang.String pSkipBlocksPattern)
@Input public boolean isIgnoreUsings()
using directives should be ignored, false if they should count.public void setIgnoreUsings(boolean pIgnoreUsings)
public void run()