Groovy Documentation

org.gradle.api.plugins.quality
[Groovy] Class FindBugs

java.lang.Object
  org.gradle.api.internal.ConventionTask
      org.gradle.api.tasks.SourceTask
          org.gradle.api.plugins.quality.FindBugs
All Implemented Interfaces:
Reporting, VerificationTask

class FindBugs
extends SourceTask

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


Property Summary
FileCollection classes

The classes to be analyzed.

FileCollection classpath

Compile class path for the classes to be analyzed.

String effort

The analysis effort level.

File excludeFilter

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

FileCollection findbugsClasspath

Class path holding the FindBugs library.

boolean ignoreFailures

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

File includeFilter

The filename of a filter specifying which bugs are reported.

String maxHeapSize

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

Collection 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 visitors

The bug detectors which should be run.

 
Constructor Summary
FindBugs(Instantiator instantiator, Factory workerFactory)

 
Method Summary
void evaluateResult(FindBugsResult result)

For testing only.

FindBugsSpec generateSpec()

For testing only.

FindBugsReports getReports()

The reports to be generated by this task.

FindBugsReports reports(Closure closure)

Configures the reports to be generated by this task.

void run()

 
Methods inherited from class SourceTask
exclude, exclude, exclude, exclude, getDefaultSource, getExcludes, getIncludes, getSource, include, include, include, include, setExcludes, setIncludes, setSource, source
 

Property Detail

classes

@SkipWhenEmpty
@InputFiles
FileCollection classes
The classes to be analyzed.


classpath

@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.


effort

@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.


excludeFilter

@InputFile
@Optional
File excludeFilter
The filename of a filter specifying bugs to exclude from being reported.


findbugsClasspath

@InputFiles
FileCollection findbugsClasspath
Class path holding the FindBugs library.


ignoreFailures

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


includeFilter

@InputFile
@Optional
File includeFilter
The filename of a filter specifying which bugs are reported.


maxHeapSize

@Input
@Optional
String maxHeapSize
The maximum heap size for the forked findbugs process (ex: '1g').


omitVisitors

@Input
@Optional
Collection omitVisitors
Similar to visitors except that it specifies bug detectors which should not be run. By default, no visitors are omitted.


pluginClasspath

@InputFiles
FileCollection pluginClasspath
Class path holding any additional FindBugs plugins.


reportLevel

@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.


visitors

@Input
@Optional
Collection 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

@Inject
FindBugs(Instantiator instantiator, Factory workerFactory)


 
Method Detail

evaluateResult

@PackageScope
void evaluateResult(FindBugsResult result)
For testing only.


generateSpec

@PackageScope
FindBugsSpec generateSpec()
For testing only.


getReports

FindBugsReports getReports()
The reports to be generated by this task.
Returns:
The reports container


reports

FindBugsReports reports(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


run

@TaskAction
void run()


 

Gradle API 1.5