|
FindBugs™ 1.3.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.umd.cs.findbugs.FindBugs2
public class FindBugs2
FindBugs driver class. Orchestrates the analysis of a project, collection of results, etc.
| Field Summary | |
|---|---|
static boolean |
DEBUG
|
static boolean |
PROGRESS
|
| Constructor Summary | |
|---|---|
FindBugs2()
Constructor. |
|
| Method Summary | |
|---|---|
void |
addClassObserver(IClassObserver classObserver)
Add an IClassObserver. |
void |
addFilter(java.lang.String filterFileName,
boolean include)
Set filter of bug instances to include or exclude. |
static void |
clearAnalysisContext()
|
static void |
createAnalysisContext(Project project,
java.util.List<ClassDescriptor> appClassList,
java.lang.String sourceInfoFileName)
Create the AnalysisContext that will serve as the BCEL-compatibility layer over the AnalysisCache. |
void |
dispose()
To avoid cyclic cross-references and allow GC after engine is not more needed. |
boolean |
emitTrainingOutput()
Return whether or not training output should be emitted after analysis completes. |
void |
enableTrainingInput(java.lang.String trainingInputDir)
Set whether or not training input should be used to make the analysis more precise. |
void |
enableTrainingOutput(java.lang.String trainingOutputDir)
Set whether or not training output should be emitted. |
void |
excludeBaselineBugs(java.lang.String baselineBugs)
Provide baseline of bugs not to report |
void |
execute()
Execute the analysis. |
void |
finishSettings()
|
int |
getBugCount()
Get the number of bug instances that were reported during analysis. |
BugReporter |
getBugReporter()
Get the BugReporter. |
java.lang.String |
getCurrentClass()
Get the name of the most recent class to be analyzed. |
int |
getErrorCount()
Get the number of errors that occurred during analysis. |
int |
getMissingClassCount()
Get the number of time missing classes were reported during analysis. |
Project |
getProject()
Get the Project. |
java.lang.String |
getProjectName()
|
java.lang.String |
getReleaseName()
|
java.lang.String |
getTrainingInputDir()
Get the training input database directory. |
java.lang.String |
getTrainingOutputDir()
Get the training output directory. |
UserPreferences |
getUserPreferences()
Get the UserPreferences. |
static void |
main(java.lang.String[] args)
|
static void |
registerBuiltInAnalysisEngines(IAnalysisCache analysisCache)
Register the "built-in" analysis engines with given IAnalysisCache. |
static void |
registerPluginAnalysisEngines(DetectorFactoryCollection detectorFactoryCollection,
IAnalysisCache analysisCache)
Register all of the analysis engines defined in the plugins contained in a DetectorFactoryCollection with an IAnalysisCache. |
void |
setAbridgedMessages(boolean xmlWithAbridgedMessages)
|
void |
setAnalysisFeatureSettings(AnalysisFeatureSetting[] settingList)
Set analysis feature settings. |
void |
setApplySuppression(boolean applySuppression)
|
void |
setBugReporter(BugReporter bugReporter)
Set the BugReporter. |
void |
setClassScreener(IClassScreener classScreener)
Set the ClassScreener. |
void |
setDetectorFactoryCollection(DetectorFactoryCollection detectorFactoryCollection)
Set the detector factory collection to be used by this FindBugs2 engine. |
void |
setMergeSimilarWarnings(boolean mergeSimilarWarnings)
|
void |
setNoClassOk(boolean noClassOk)
Set whether or not to generate an empty output file if there were no class files specified. |
void |
setProgressCallback(FindBugsProgress progressCallback)
Set the progress callback that will be used to keep track of the progress of the analysis. |
void |
setProject(Project project)
Set the Project. |
void |
setProjectName(java.lang.String name)
|
void |
setRankThreshold(int rankThreshold)
|
void |
setRelaxedReportingMode(boolean relaxedReportingMode)
Set relaxed reporting mode. |
void |
setReleaseName(java.lang.String releaseName)
|
void |
setScanNestedArchives(boolean scanNestedArchives)
Set whether or not nested archives should be scanned. |
void |
setSourceInfoFile(java.lang.String sourceInfoFile)
Set the filename of the source info file containing line numbers for fields and classes. |
void |
setUserPreferences(UserPreferences userPreferences)
Set the UserPreferences representing which Detectors should be used. |
java.util.List<ClassDescriptor> |
sortByCallGraph(java.util.Collection<ClassDescriptor> classList,
TopologicalSort.OutEdges<ClassDescriptor> outEdges)
|
boolean |
useTrainingInput()
Return whether or not we should make use of training data. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean DEBUG
public static final boolean PROGRESS
| Constructor Detail |
|---|
public FindBugs2()
| Method Detail |
|---|
public void setDetectorFactoryCollection(DetectorFactoryCollection detectorFactoryCollection)
setDetectorFactoryCollection in interface IFindBugsEnginedetectorFactoryCollection - The detectorFactoryCollection to set.
public void execute()
throws java.io.IOException,
java.lang.InterruptedException
execute in interface IFindBugsEnginejava.io.IOException
java.lang.InterruptedExceptionpublic void dispose()
public BugReporter getBugReporter()
IFindBugsEngine
getBugReporter in interface IFindBugsEnginepublic Project getProject()
IFindBugsEngine
getProject in interface IFindBugsEnginepublic void addClassObserver(IClassObserver classObserver)
IFindBugsEngine
addClassObserver in interface IFindBugsEngineclassObserver - the IClassObserver
public void addFilter(java.lang.String filterFileName,
boolean include)
throws java.io.IOException,
FilterException
IFindBugsEngine
addFilter in interface IFindBugsEnginefilterFileName - the name of the filter fileinclude - true if the filter specifies bug instances to include,
false if it specifies bug instances to exclude
java.io.IOException
FilterException
public void excludeBaselineBugs(java.lang.String baselineBugs)
throws java.io.IOException,
org.dom4j.DocumentException
IFindBugsEngine
excludeBaselineBugs in interface IFindBugsEnginebaselineBugs - the name of the xml bug baseline file
org.dom4j.DocumentException
java.io.IOExceptionpublic void enableTrainingInput(java.lang.String trainingInputDir)
IFindBugsEngine
enableTrainingInput in interface IFindBugsEnginetrainingInputDir - directory to load training input frompublic void enableTrainingOutput(java.lang.String trainingOutputDir)
IFindBugsEngine
enableTrainingOutput in interface IFindBugsEnginetrainingOutputDir - directory to save training output inpublic int getBugCount()
IFindBugsEngine
getBugCount in interface IFindBugsEnginepublic java.lang.String getCurrentClass()
IFindBugsEngine
getCurrentClass in interface IFindBugsEnginepublic int getErrorCount()
IFindBugsEngine
getErrorCount in interface IFindBugsEnginepublic int getMissingClassCount()
IFindBugsEngine
getMissingClassCount in interface IFindBugsEnginepublic java.lang.String getReleaseName()
getReleaseName in interface IFindBugsEnginepublic java.lang.String getProjectName()
getProjectName in interface IFindBugsEnginepublic void setProjectName(java.lang.String name)
setProjectName in interface IFindBugsEnginename - The project name to set.public void setAnalysisFeatureSettings(AnalysisFeatureSetting[] settingList)
IFindBugsEngine
setAnalysisFeatureSettings in interface IFindBugsEnginesettingList - list of analysis feature settingspublic void setBugReporter(BugReporter bugReporter)
IFindBugsEngine
setBugReporter in interface IFindBugsEnginebugReporter - The BugReporter to setpublic void setClassScreener(IClassScreener classScreener)
IFindBugsEngine
setClassScreener in interface IFindBugsEngineclassScreener - the ClassScreener to usepublic void setProgressCallback(FindBugsProgress progressCallback)
IFindBugsEngine
setProgressCallback in interface IFindBugsEngineprogressCallback - the progress callbackpublic void setProject(Project project)
IFindBugsEngine
setProject in interface IFindBugsEngineproject - The Project to setpublic void setRelaxedReportingMode(boolean relaxedReportingMode)
IFindBugsEngine
setRelaxedReportingMode in interface IFindBugsEnginerelaxedReportingMode - true if relaxed reporting mode should be enabled,
false if notpublic void setReleaseName(java.lang.String releaseName)
setReleaseName in interface IFindBugsEnginereleaseName - The releaseName to set.public void setSourceInfoFile(java.lang.String sourceInfoFile)
IFindBugsEngine
setSourceInfoFile in interface IFindBugsEnginesourceInfoFile - the source info filenamepublic void setUserPreferences(UserPreferences userPreferences)
IFindBugsEngine
setUserPreferences in interface IFindBugsEngineuserPreferences - the UserPreferencespublic boolean emitTrainingOutput()
IFindBugsEngine
emitTrainingOutput in interface IFindBugsEnginepublic UserPreferences getUserPreferences()
IFindBugsEngine
getUserPreferences in interface IFindBugsEnginepublic java.lang.String getTrainingInputDir()
IFindBugsEngine
getTrainingInputDir in interface IFindBugsEnginepublic java.lang.String getTrainingOutputDir()
IFindBugsEngine
getTrainingOutputDir in interface IFindBugsEnginepublic boolean useTrainingInput()
IFindBugsEngine
useTrainingInput in interface IFindBugsEnginepublic void setScanNestedArchives(boolean scanNestedArchives)
IFindBugsEngine
setScanNestedArchives in interface IFindBugsEnginescanNestedArchives - true if nested archives should be scanned, false if notpublic void setNoClassOk(boolean noClassOk)
IFindBugsEngine
setNoClassOk in interface IFindBugsEnginenoClassOk - true if FindBugs should generate empty output filepublic static void registerBuiltInAnalysisEngines(IAnalysisCache analysisCache)
analysisCache - an IAnalysisCache
public static void registerPluginAnalysisEngines(DetectorFactoryCollection detectorFactoryCollection,
IAnalysisCache analysisCache)
throws java.io.IOException
detectorFactoryCollection - a DetectorFactoryCollectionanalysisCache - an IAnalysisCache
java.io.IOException
public java.util.List<ClassDescriptor> sortByCallGraph(java.util.Collection<ClassDescriptor> classList,
TopologicalSort.OutEdges<ClassDescriptor> outEdges)
public static void clearAnalysisContext()
public static void createAnalysisContext(Project project,
java.util.List<ClassDescriptor> appClassList,
java.lang.String sourceInfoFileName)
throws CheckedAnalysisException,
java.io.IOException
project - The projectappClassList - list of ClassDescriptors identifying application classessourceInfoFileName - name of source info file (null if none)
CheckedAnalysisException
java.io.IOException
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exceptionpublic void setAbridgedMessages(boolean xmlWithAbridgedMessages)
setAbridgedMessages in interface IFindBugsEnginepublic void setMergeSimilarWarnings(boolean mergeSimilarWarnings)
setMergeSimilarWarnings in interface IFindBugsEnginepublic void setApplySuppression(boolean applySuppression)
setApplySuppression in interface IFindBugsEnginepublic void setRankThreshold(int rankThreshold)
setRankThreshold in interface IFindBugsEngine2public void finishSettings()
finishSettings in interface IFindBugsEngine
|
FindBugs™ 1.3.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||