Package: org.gradle.api.plugins.quality

## [Java] Class FindBugsExtension

- org.gradle.api.plugins.quality.FindBugsExtension

- Configuration options for the FindBugs plugin. All options have sensible defaults. See the FindBugs Manual for additional information on these options.

  Below is a full configuration example. Since all properties have sensible defaults, typically only selected properties will be configured.

           apply plugin: "java"
           apply plugin: "findbugs"

           findbugs {
               toolVersion = "2.0.1"
               sourceSets = [sourceSets.main]
               ignoreFailures = true
               reportsDir = file("$project.buildDir/findbugsReports")
               effort = "max"
               reportLevel = "high"
               visitors = ["FindSqlInjection", "SwitchFallthrough"]
               omitVisitors = ["FindNonShortCircuit"]
               includeFilter = file("$rootProject.projectDir/config/findbugs/includeFilter.xml")
               excludeFilter = file("$rootProject.projectDir/config/findbugs/excludeFilter.xml")
               excludeBugsFilter = file("$rootProject.projectDir/config/findbugs/excludeBugsFilter.xml")
           }

  See Also:
    FindBugsPlugin

- - ### Constructor Summary

    Constructors
    Constructor and description
    `FindBugsExtension (Project project)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `String` | `getEffort()` The analysis effort level.
    `File` | `getExcludeBugsFilter()` The filename of a filter specifying baseline bugs to exclude from being reported.
    `TextResource` | `getExcludeBugsFilterConfig()` A filter specifying baseline bugs to exclude from being reported.
    `File` | `getExcludeFilter()` The filename of a filter specifying bugs to exclude from being reported.
    `TextResource` | `getExcludeFilterConfig()` A filter specifying bugs to exclude from being reported.
    `Collection<String>` | `getExtraArgs()` Any additional arguments (not covered here more explicitly like `effort`) to be passed along to FindBugs.
    `File` | `getIncludeFilter()` The filename of a filter specifying which bugs are reported.
    `TextResource` | `getIncludeFilterConfig()` A filter specifying which bugs are reported.
    `Collection<String>` | `getOmitVisitors()` Similar to `visitors` except that it specifies bug detectors which should not be run.
    `String` | `getReportLevel()` The priority threshold for reporting bugs.
    `Collection<String>` | `getVisitors()` The bug detectors which should be run.
    `void` | `setEffort(String effort)`
    `void` | `setExcludeBugsFilter(File filter)` The filename of a filter specifying baseline bugs to exclude from being reported.
    `void` | `setExcludeBugsFilterConfig(TextResource excludeBugsFilterConfig)`
    `void` | `setExcludeFilter(File filter)` The filename of a filter specifying bugs to exclude from being reported.
    `void` | `setExcludeFilterConfig(TextResource excludeFilterConfig)`
    `void` | `setExtraArgs(Collection<String> extraArgs)`
    `void` | `setIncludeFilter(File filter)` The filename of a filter specifying which bugs are reported.
    `void` | `setIncludeFilterConfig(TextResource includeFilterConfig)`
    `void` | `setOmitVisitors(Collection<String> omitVisitors)`
    `void` | `setReportLevel(String reportLevel)`
    `void` | `setVisitors(Collection<String> visitors)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class CodeQualityExtension` | `getIgnoreFailures, getReportsDir, getSourceSets, getToolVersion, isIgnoreFailures, setIgnoreFailures, setReportsDir, setSourceSets, setToolVersion`
    `class groovy.lang.GroovyObjectSupport` | `groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll()`

- - ### Constructor Detail

    - #### public FindBugsExtension(Project project)

  - ### Method Detail

    - #### public String getEffort()

      The analysis effort level. The value specified should be one of `min`, `default`, or `max`. Higher levels increase precision and find more bugs at the expense of running time and memory consumption.

    - #### public File getExcludeBugsFilter()

      The filename of a filter specifying baseline bugs to exclude from being reported.

    - #### @Incubating public TextResource getExcludeBugsFilterConfig()

      A filter specifying baseline bugs to exclude from being reported.

      Since:
        2.4

    - #### public File getExcludeFilter()

      The filename of a filter specifying bugs to exclude from being reported.

    - #### @Incubating public TextResource getExcludeFilterConfig()

      A filter specifying bugs to exclude from being reported. Replaces the `excludeFilter` property.

      Since:
        2.2

    - #### public Collection<String> getExtraArgs()

      Any additional arguments (not covered here more explicitly like `effort`) to be passed along to FindBugs.

      Extra arguments are passed to FindBugs 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 FindBugs.

      See the FindBugs TextUICommandLine source for available options.

      Since:
        2.6

    - #### public File getIncludeFilter()

      The filename of a filter specifying which bugs are reported.

    - #### @Incubating public TextResource getIncludeFilterConfig()

      A filter specifying which bugs are reported. Replaces the `includeFilter` property.

      Since:
        2.2

    - #### public Collection<String> getOmitVisitors()

      Similar to `visitors` except that it specifies bug detectors which should not be run. By default, no visitors are omitted.

    - #### public String getReportLevel()

      The priority threshold for reporting bugs. If set to `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 Collection<String> getVisitors()

      The bug detectors which should be run. The bug detectors are specified by their class names, without any package qualification. By default, all detectors which are not disabled by default are run.

    - #### public void setEffort(String effort)

    - #### public void setExcludeBugsFilter(File filter)

      The filename of a filter specifying baseline bugs to exclude from being reported.

    - #### @Incubating public void setExcludeBugsFilterConfig(TextResource excludeBugsFilterConfig)

    - #### public void setExcludeFilter(File filter)

      The filename of a filter specifying bugs to exclude from being reported.

    - #### @Incubating public void setExcludeFilterConfig(TextResource excludeFilterConfig)

    - #### public void setExtraArgs(Collection<String> extraArgs)

    - #### public void setIncludeFilter(File filter)

      The filename of a filter specifying which bugs are reported.

    - #### @Incubating public void setIncludeFilterConfig(TextResource includeFilterConfig)

    - #### public void setOmitVisitors(Collection<String> omitVisitors)

    - #### public void setReportLevel(String reportLevel)

    - #### public void setVisitors(Collection<String> visitors)