Interface IFindBugsEngine
- All Known Implementing Classes:
FindBugs2
public interface IFindBugsEngine
Interface for a FindBugs engine class. An instance of this interface takes a
project, user configuration options, orchestrates the analysis of the classes
in the project, and reports the results to the configured BugReporter.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddClassObserver(IClassObserver classObserver) Add an IClassObserver.voidSet filter of bug instances to include or exclude.booleanReturn whether or not training output should be emitted after analysis completes.voidenableTrainingInput(String trainingInputDir) Set whether or not training input should be used to make the analysis more precise.voidenableTrainingOutput(String trainingOutputDir) Set whether or not training output should be emitted.voidexcludeBaselineBugs(String baselineBugs) Provide baseline of bugs not to reportvoidexecute()Execute FindBugs on the Project.voidintGet the number of bug instances that were reported during analysis.Get the BugReporter.Get the name of the most recent class to be analyzed.intGet the number of errors that occurred during analysis.intGet the number of time missing classes were reported during analysis.Get the Project.Get the training input database directory.Get the training output directory.Get the UserPreferences.voidsetAbridgedMessages(boolean xmlWithAbridgedMessages) voidsetAnalysisFeatureSettings(AnalysisFeatureSetting[] settingList) Set analysis feature settings.voidsetApplySuppression(boolean applySuppression) voidsetBugReporter(BugReporter bugReporter) Set the BugReporter.voidsetBugReporterDecorators(Set<String> explicitlyEnabled, Set<String> explicitlyDisabled) voidsetClassScreener(IClassScreener classScreener) Set the ClassScreener.voidsetDetectorFactoryCollection(DetectorFactoryCollection detectorFactoryCollection) Set the DetectorFactoryCollection from which plugins/detectors may be accessed.voidsetMergeSimilarWarnings(boolean mergeSimilarWarnings) voidsetNoClassOk(boolean noClassOk) Set whether or not to generate an empty output file if there were no class files specified.voidsetProgressCallback(FindBugsProgress progressCallback) Set the progress callback that will be used to keep track of the progress of the analysis.voidsetProject(Project project) Set the Project.voidsetProjectName(String projectName) voidsetRankThreshold(int rankThreshold) voidsetRelaxedReportingMode(boolean relaxedReportingMode) Set relaxed reporting mode.voidsetReleaseName(String releaseName) voidsetScanNestedArchives(boolean scanNestedArchives) Set whether or not nested archives should be scanned.voidsetSourceInfoFile(String sourceInfoFile) Set the filename of the source info file containing line numbers for fields and classes.voidsetUserPreferences(UserPreferences userPreferences) Set the UserPreferences representing which Detectors should be used.booleanReturn whether or not we should make use of training data.
-
Method Details
-
getBugReporter
-
setBugReporter
Set the BugReporter.- Parameters:
bugReporter- The BugReporter to set
-
setProject
-
getProject
-
setProgressCallback
Set the progress callback that will be used to keep track of the progress of the analysis.- Parameters:
progressCallback- the progress callback
-
addFilter
Set filter of bug instances to include or exclude.- Parameters:
filterFileName- the name of the filter fileinclude- true if the filter specifies bug instances to include, false if it specifies bug instances to exclude- Throws:
IOExceptionFilterException
-
excludeBaselineBugs
Provide baseline of bugs not to report- Parameters:
baselineBugs- the name of the xml bug baseline file- Throws:
org.dom4j.DocumentExceptionIOException
-
setUserPreferences
Set the UserPreferences representing which Detectors should be used. If UserPreferences are not set explicitly, the default set of Detectors will be used.- Parameters:
userPreferences- the UserPreferences
-
addClassObserver
Add an IClassObserver.- Parameters:
classObserver- the IClassObserver
-
setClassScreener
Set the ClassScreener. This object chooses which individual classes to analyze. By default, all classes are analyzed.- Parameters:
classScreener- the ClassScreener to use
-
setRelaxedReportingMode
void setRelaxedReportingMode(boolean relaxedReportingMode) Set relaxed reporting mode.- Parameters:
relaxedReportingMode- true if relaxed reporting mode should be enabled, false if not
-
enableTrainingOutput
Set whether or not training output should be emitted.- Parameters:
trainingOutputDir- directory to save training output in
-
enableTrainingInput
Set whether or not training input should be used to make the analysis more precise.- Parameters:
trainingInputDir- directory to load training input from
-
setAnalysisFeatureSettings
Set analysis feature settings.- Parameters:
settingList- list of analysis feature settings
-
getReleaseName
String getReleaseName()- Returns:
- Returns the releaseName.
-
setReleaseName
- Parameters:
releaseName- The releaseName to set.
-
getProjectName
String getProjectName()- Returns:
- Returns the projectName.
-
setProjectName
- Parameters:
projectName- The project name to set.
-
setSourceInfoFile
Set the filename of the source info file containing line numbers for fields and classes.- Parameters:
sourceInfoFile- the source info filename
-
execute
Execute FindBugs on the Project. All bugs found are reported to the BugReporter object which was set when this object was constructed.- Throws:
IOException- if an I/O exception occurs analyzing one of the filesInterruptedException- if the thread is interrupted while conducting the analysis
-
getCurrentClass
String getCurrentClass()Get the name of the most recent class to be analyzed. This is useful for diagnosing an unexpected exception. Returns null if no class has been analyzed. -
getBugCount
int getBugCount()Get the number of bug instances that were reported during analysis. -
getErrorCount
int getErrorCount()Get the number of errors that occurred during analysis. -
getMissingClassCount
int getMissingClassCount()Get the number of time missing classes were reported during analysis. -
getUserPreferences
-
emitTrainingOutput
boolean emitTrainingOutput()Return whether or not training output should be emitted after analysis completes.- Returns:
- true if training output should be emitted, false if not
-
getTrainingOutputDir
String getTrainingOutputDir()Get the training output directory.- Returns:
- the training output directory
-
useTrainingInput
boolean useTrainingInput()Return whether or not we should make use of training data.- Returns:
- true if training data should be used, false if not
-
getTrainingInputDir
String getTrainingInputDir()Get the training input database directory.- Returns:
- the training input database directory
-
setScanNestedArchives
void setScanNestedArchives(boolean scanNestedArchives) Set whether or not nested archives should be scanned.- Parameters:
scanNestedArchives- true if nested archives should be scanned, false if not
-
setNoClassOk
void setNoClassOk(boolean noClassOk) Set whether or not to generate an empty output file if there were no class files specified.- Parameters:
noClassOk- true if FindBugs should generate empty output file
-
setDetectorFactoryCollection
Set the DetectorFactoryCollection from which plugins/detectors may be accessed.- Parameters:
detectorFactoryCollection- the DetectorFactoryCollection
-
setAbridgedMessages
void setAbridgedMessages(boolean xmlWithAbridgedMessages) - Parameters:
xmlWithAbridgedMessages-
-
setMergeSimilarWarnings
void setMergeSimilarWarnings(boolean mergeSimilarWarnings) -
setApplySuppression
void setApplySuppression(boolean applySuppression) -
finishSettings
void finishSettings() -
setRankThreshold
void setRankThreshold(int rankThreshold) -
setBugReporterDecorators
-