Package: org.gradle.api.plugins.quality

## [Groovy] Class FindBugs

- org.gradle.api.plugins.quality.FindBugs

- All Implemented Interfaces and Traits:
    Reporting, VerificationTask

      @groovy.transform.CompileStatic
      class FindBugs
      extends SourceTask

  Analyzes code with FindBugs. See the FindBugs Manual for additional information on configuration options.

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class SourceTask` | `TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION`
    `class org.gradle.api.internal.ConventionTask` | `TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION`

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `FileCollection` | `classes` The classes to be analyzed.
    `FileCollection` | `classpath` Compile class path for the classes to be analyzed.
    `String` | `effort` The analysis effort level.
    `TextResource` | `excludeBugsFilterConfig` A filter specifying baseline bugs to exclude from being reported.
    `TextResource` | `excludeFilterConfig` A filter specifying bugs to exclude from being reported.
    `Collection<String>` | `extraArgs` Any additional arguments (not covered here more explicitly like `effort`) to be passed along to FindBugs.
    `FileCollection` | `findbugsClasspath` Class path holding the FindBugs library.
    `boolean` | `ignoreFailures` Whether or not to allow the build to continue if there are warnings.
    `TextResource` | `includeFilterConfig` A filter specifying which bugs are reported.
    `String` | `maxHeapSize` The maximum heap size for the forked findbugs process (ex: '1g').
    `Collection<String>` | `omitVisitors` Similar to `visitors` except that it specifies bug detectors which should not be run.
    `FileCollection` | `pluginClasspath` Class path holding any additional FindBugs plugins.
    `String` | `reportLevel` The priority threshold for reporting bugs.
    `Collection<String>` | `visitors` The bug detectors which should be run.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `FindBugs ()`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `FindBugs` | `extraArgs(Iterable<String> arguments)`
    `FindBugs` | `extraArgs(String... arguments)`
    `File` | `getExcludeBugsFilter()` The filename of a filter specifying baseline bugs to exclude from being reported.
    `File` | `getExcludeFilter()` The filename of a filter specifying bugs to exclude from being reported.
    `File` | `getIncludeFilter()` The filename of a filter specifying which bugs are reported.
    `org.gradle.internal.reflect.Instantiator` | `getInstantiator()`
    `FindBugsReports` | `getReports()` The reports to be generated by this task.
    `org.gradle.process.internal.worker.WorkerProcessFactory` | `getWorkerProcessBuilderFactory()`
    `FindBugsReports` | `reports(groovy.lang.Closure closure)` Configures the reports to be generated by this task.
    `void` | `run()`
    `void` | `setExcludeBugsFilter(File filter)` The filename of a filter specifying baseline bugs to exclude from being reported.
    `void` | `setExcludeFilter(File filter)` The filename of a filter specifying bugs to exclude from being reported.
    `void` | `setIncludeFilter(File filter)` The filename of a filter specifying which bugs are reported.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class SourceTask` | `source, getSource, getIncludes, setIncludes, setIncludes, include, include, include, include, include, include, include, include, getExcludes, setExcludes, setExcludes, exclude, exclude, exclude, exclude, exclude, exclude, exclude, exclude, setSource, conventionMapping, conventionMapping, getConventionMapping, setProperty, toString, compareTo, compareTo, getName, getActions, setName, getState, getState, getPath, getExtensions, getLogger, execute, configure, configure, getDescription, leftShift, property, isEnabled, setEnabled, getOutputs, getOutputs, onlyIf, onlyIf, setOnlyIf, setOnlyIf, setDidWork, getDidWork, doFirst, doFirst, doLast, doLast, deleteAllActions, getEnabled, getAnt, getLogging, getLogging, hasProperty, getConvention, setDescription, getGroup, setGroup, getTaskDependencies, getTaskDependencies, setDependsOn, dependsOn, getProject, setActions, getDependsOn, dependsOnTaskDidWork, getInputs, getTemporaryDir, mustRunAfter, setMustRunAfter, getMustRunAfter, finalizedBy, setFinalizedBy, getFinalizedBy, shouldRunAfter, setShouldRunAfter, getShouldRunAfter, getStandardOutputCapture, getAsDynamicObject, setProject, injectIntoNewInstance, prependParallelSafeAction, getOnlyIf, getImpliesSubProjects, setImpliesSubProjects, getExecuter, setExecuter, getTemporaryDirFactory, addValidator, getValidators, appendParallelSafeAction, isHasCustomActions, getTaskActions, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll`
    `class org.gradle.api.internal.ConventionTask` | `org.gradle.api.internal.ConventionTask#conventionMapping(java.lang.String, groovy.lang.Closure), org.gradle.api.internal.ConventionTask#conventionMapping(java.lang.String, java.util.concurrent.Callable), org.gradle.api.internal.ConventionTask#getConventionMapping(), org.gradle.api.internal.ConventionTask#setProperty(java.lang.String, java.lang.Object), org.gradle.api.internal.ConventionTask#toString(), org.gradle.api.internal.ConventionTask#compareTo(org.gradle.api.Task), org.gradle.api.internal.ConventionTask#compareTo(java.lang.Object), org.gradle.api.internal.ConventionTask#getName(), org.gradle.api.internal.ConventionTask#getActions(), org.gradle.api.internal.ConventionTask#setName(java.lang.String), org.gradle.api.internal.ConventionTask#getState(), org.gradle.api.internal.ConventionTask#getState(), org.gradle.api.internal.ConventionTask#getPath(), org.gradle.api.internal.ConventionTask#getExtensions(), org.gradle.api.internal.ConventionTask#getLogger(), org.gradle.api.internal.ConventionTask#execute(), org.gradle.api.internal.ConventionTask#configure(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#configure(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#getDescription(), org.gradle.api.internal.ConventionTask#leftShift(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#property(java.lang.String), org.gradle.api.internal.ConventionTask#isEnabled(), org.gradle.api.internal.ConventionTask#setEnabled(boolean), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#onlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.ConventionTask#onlyIf(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#setOnlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.ConventionTask#setOnlyIf(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#setDidWork(boolean), org.gradle.api.internal.ConventionTask#getDidWork(), org.gradle.api.internal.ConventionTask#doFirst(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#doFirst(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#doLast(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#doLast(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#deleteAllActions(), org.gradle.api.internal.ConventionTask#getEnabled(), org.gradle.api.internal.ConventionTask#getAnt(), org.gradle.api.internal.ConventionTask#getLogging(), org.gradle.api.internal.ConventionTask#getLogging(), org.gradle.api.internal.ConventionTask#hasProperty(java.lang.String), org.gradle.api.internal.ConventionTask#getConvention(), org.gradle.api.internal.ConventionTask#setDescription(java.lang.String), org.gradle.api.internal.ConventionTask#getGroup(), org.gradle.api.internal.ConventionTask#setGroup(java.lang.String), org.gradle.api.internal.ConventionTask#getTaskDependencies(), org.gradle.api.internal.ConventionTask#getTaskDependencies(), org.gradle.api.internal.ConventionTask#setDependsOn(java.lang.Iterable), org.gradle.api.internal.ConventionTask#dependsOn([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#getProject(), org.gradle.api.internal.ConventionTask#setActions(java.util.List), org.gradle.api.internal.ConventionTask#getDependsOn(), org.gradle.api.internal.ConventionTask#dependsOnTaskDidWork(), org.gradle.api.internal.ConventionTask#getInputs(), org.gradle.api.internal.ConventionTask#getTemporaryDir(), org.gradle.api.internal.ConventionTask#mustRunAfter([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#setMustRunAfter(java.lang.Iterable), org.gradle.api.internal.ConventionTask#getMustRunAfter(), org.gradle.api.internal.ConventionTask#finalizedBy([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#setFinalizedBy(java.lang.Iterable), org.gradle.api.internal.ConventionTask#getFinalizedBy(), org.gradle.api.internal.ConventionTask#shouldRunAfter([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#setShouldRunAfter(java.lang.Iterable), org.gradle.api.internal.ConventionTask#getShouldRunAfter(), org.gradle.api.internal.ConventionTask#getStandardOutputCapture(), org.gradle.api.internal.ConventionTask#getAsDynamicObject(), org.gradle.api.internal.ConventionTask#setProject(org.gradle.api.Project), org.gradle.api.internal.ConventionTask#injectIntoNewInstance(org.gradle.api.internal.project.ProjectInternal, java.lang.String, java.lang.Class, java.util.concurrent.Callable), org.gradle.api.internal.ConventionTask#prependParallelSafeAction(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#getOnlyIf(), org.gradle.api.internal.ConventionTask#getImpliesSubProjects(), org.gradle.api.internal.ConventionTask#setImpliesSubProjects(boolean), org.gradle.api.internal.ConventionTask#getExecuter(), org.gradle.api.internal.ConventionTask#setExecuter(org.gradle.api.internal.tasks.TaskExecuter), org.gradle.api.internal.ConventionTask#getTemporaryDirFactory(), org.gradle.api.internal.ConventionTask#addValidator(org.gradle.api.internal.tasks.execution.TaskValidator), org.gradle.api.internal.ConventionTask#getValidators(), org.gradle.api.internal.ConventionTask#appendParallelSafeAction(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#isHasCustomActions(), org.gradle.api.internal.ConventionTask#getTaskActions(), org.gradle.api.internal.ConventionTask#wait(long, int), org.gradle.api.internal.ConventionTask#wait(long), org.gradle.api.internal.ConventionTask#wait(), org.gradle.api.internal.ConventionTask#equals(java.lang.Object), org.gradle.api.internal.ConventionTask#hashCode(), org.gradle.api.internal.ConventionTask#getClass(), org.gradle.api.internal.ConventionTask#notify(), org.gradle.api.internal.ConventionTask#notifyAll()`

- - ### Property Detail

    - #### @SkipWhenEmpty @InputFiles FileCollection classes

      The classes to be analyzed.

    - #### @InputFiles FileCollection classpath

      Compile class path for the classes to be analyzed. The classes on this class path are used during analysis but aren't analyzed themselves.

    - #### @Input @Optional String effort

      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.

    - #### @Incubating @Nested @Optional TextResource excludeBugsFilterConfig

      A filter specifying baseline bugs to exclude from being reported.

    - #### @Incubating @Nested @Optional TextResource excludeFilterConfig

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

      Since:
        2.2

    - #### @Input @Optional Collection<String> extraArgs

      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

    - #### @InputFiles FileCollection findbugsClasspath

      Class path holding the FindBugs library.

    - #### boolean ignoreFailures

      Whether or not to allow the build to continue if there are warnings.

    - #### @Incubating @Nested @Optional TextResource includeFilterConfig

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

      Since:
        2.2

    - #### @Input @Optional String maxHeapSize

      The maximum heap size for the forked findbugs process (ex: '1g').

    - #### @Input @Optional Collection<String> omitVisitors

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

    - #### @InputFiles FileCollection pluginClasspath

      Class path holding any additional FindBugs plugins.

    - #### @Input @Optional String reportLevel

      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.

    - #### @Input @Optional Collection<String> visitors

      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.

  - ### Constructor Detail

    - #### FindBugs()

  - ### Method Detail

    - #### FindBugs extraArgs(Iterable<String> arguments)

    - #### FindBugs extraArgs(String... arguments)

    - #### File getExcludeBugsFilter()

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

    - #### File getExcludeFilter()

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

    - #### File getIncludeFilter()

      The filename of a filter specifying which bugs are reported.

    - #### @javax.inject.Inject org.gradle.internal.reflect.Instantiator getInstantiator()

    - #### FindBugsReports getReports()

      The reports to be generated by this task.

      Returns:
        The reports container

    - #### @javax.inject.Inject org.gradle.process.internal.worker.WorkerProcessFactory getWorkerProcessBuilderFactory()

    - #### FindBugsReports reports(groovy.lang.Closure closure)

      Configures the reports to be generated by this task. The contained reports can be configured by name and closures. Example:

           findbugsTask {
             reports {
               xml {
                 destination "build/findbugs.xml"
               }
             }
           }

      Parameters:
        `closure` - The configuration
      Returns:
        The reports container

    - #### @TaskAction void run()

    - #### void setExcludeBugsFilter(File filter)

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

    - #### void setExcludeFilter(File filter)

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

    - #### void setIncludeFilter(File filter)

      The filename of a filter specifying which bugs are reported.