public class SpotBugsExtension
extends org.gradle.api.plugins.quality.CodeQualityExtension
Below is a full configuration example. Since all properties have sensible defaults, typically only selected properties will be configured. apply plugin: "java" apply plugin: "spotbugs" spotbugs { toolVersion = "2.0.1" sourceSets = [sourceSets.main] ignoreFailures = true reportsDir = file("$project.buildDir/spotbugsReports") effort = "max" reportLevel = "high" visitors = ["FindSqlInjection", "SwitchFallthrough"] omitVisitors = ["FindNonShortCircuit"] includeFilter = file("$rootProject.projectDir/config/spotbugs/includeFilter.xml") excludeFilter = file("$rootProject.projectDir/config/spotbugs/excludeFilter.xml") excludeBugsFilter = file("$rootProject.projectDir/config/spotbugs/excludeBugsFilter.xml") }
SpotBugsPlugin| Constructor and Description |
|---|
SpotBugsExtension(org.gradle.api.Project project) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getEffort()
The analysis effort level.
|
java.io.File |
getExcludeBugsFilter()
The filename of a filter specifying baseline bugs to exclude from being reported.
|
org.gradle.api.resources.TextResource |
getExcludeBugsFilterConfig()
A filter specifying baseline bugs to exclude from being reported.
|
java.io.File |
getExcludeFilter()
The filename of a filter specifying bugs to exclude from being reported.
|
org.gradle.api.resources.TextResource |
getExcludeFilterConfig()
A filter specifying bugs to exclude from being reported.
|
java.util.Collection<java.lang.String> |
getExtraArgs()
Any additional arguments (not covered here more explicitly like
effort) to be passed along to SpotBugs. |
java.io.File |
getIncludeFilter()
The filename of a filter specifying which bugs are reported.
|
org.gradle.api.resources.TextResource |
getIncludeFilterConfig()
A filter specifying which bugs are reported.
|
java.util.Collection<java.lang.String> |
getOmitVisitors()
Similar to
visitors except that it specifies bug detectors which should not be run. |
java.lang.String |
getReportLevel()
The priority threshold for reporting bugs.
|
java.util.Collection<java.lang.String> |
getVisitors()
The bug detectors which should be run.
|
void |
setEffort(java.lang.String effort) |
void |
setExcludeBugsFilter(java.io.File filter)
The filename of a filter specifying baseline bugs to exclude from being reported.
|
void |
setExcludeBugsFilterConfig(org.gradle.api.resources.TextResource excludeBugsFilterConfig) |
void |
setExcludeFilter(java.io.File filter)
The filename of a filter specifying bugs to exclude from being reported.
|
void |
setExcludeFilterConfig(org.gradle.api.resources.TextResource excludeFilterConfig) |
void |
setExtraArgs(java.util.Collection<java.lang.String> extraArgs) |
void |
setIncludeFilter(java.io.File filter)
The filename of a filter specifying which bugs are reported.
|
void |
setIncludeFilterConfig(org.gradle.api.resources.TextResource includeFilterConfig) |
void |
setOmitVisitors(java.util.Collection<java.lang.String> omitVisitors) |
void |
setReportLevel(java.lang.String reportLevel) |
void |
setVisitors(java.util.Collection<java.lang.String> visitors) |
public java.lang.String getEffort()
min, default, or max.
Higher levels increase precision and find more bugs at the expense of running time and memory consumption.public void setEffort(java.lang.String effort)
effort - analysis effort levelpublic java.lang.String getReportLevel()
low, all bugs are reported. If set to medium
(the default), medium and high priority bugs are reported. If set to high, only high priority bugs are
reported.public void setReportLevel(java.lang.String reportLevel)
reportLevel - priority threshold for reporting bugspublic java.util.Collection<java.lang.String> getVisitors()
public void setVisitors(java.util.Collection<java.lang.String> visitors)
visitors - bug detectors which should be runpublic java.util.Collection<java.lang.String> getOmitVisitors()
visitors except that it specifies bug detectors which should not be run. By default, no
visitors are omitted.public void setOmitVisitors(java.util.Collection<java.lang.String> omitVisitors)
omitVisitors - bug detectors which should not be run@Incubating public org.gradle.api.resources.TextResource getIncludeFilterConfig()
includeFilter property.@Incubating public void setIncludeFilterConfig(org.gradle.api.resources.TextResource includeFilterConfig)
public java.io.File getIncludeFilter()
public void setIncludeFilter(java.io.File filter)
filter - filename of a filter specifying which bugs are reported@Incubating public org.gradle.api.resources.TextResource getExcludeFilterConfig()
excludeFilter property.@Incubating public void setExcludeFilterConfig(org.gradle.api.resources.TextResource excludeFilterConfig)
excludeFilterConfig - filter specifying bugs to exclude from being reportedpublic java.io.File getExcludeFilter()
public void setExcludeFilter(java.io.File filter)
filter - filename of a filter specifying bugs to exclude from being reported@Incubating public org.gradle.api.resources.TextResource getExcludeBugsFilterConfig()
@Incubating public void setExcludeBugsFilterConfig(org.gradle.api.resources.TextResource excludeBugsFilterConfig)
excludeBugsFilterConfig - filter specifying baseline bugs to exclude from being reportpublic java.io.File getExcludeBugsFilter()
public void setExcludeBugsFilter(java.io.File filter)
filter - filename of a filter specifying baseline bugs to exclude from being reportedpublic java.util.Collection<java.lang.String> getExtraArgs()
effort) to be passed along to SpotBugs.
Extra arguments are passed to SpotBugs after the arguments Gradle understands (like effort but before the
list of classes to analyze. This should only be used for arguments that cannot be provided by Gradle directly.
Gradle does not try to interpret or validate the arguments before passing them to SpotBugs.
See the SpotBugs TextUICommandLine source for available options.
effort) to be passed along to
SpotBugspublic void setExtraArgs(java.util.Collection<java.lang.String> extraArgs)
extraArgs - any additional arguments (not covered here more explicitly like effort) to be passed along to
SpotBugs