public abstract class FindBugs
extends java.lang.Object
FindBugs2
.Modifier and Type | Field and Description |
---|---|
static boolean |
DEBUG
Debug tracing.
|
static AnalysisFeatureSetting[] |
DEFAULT_EFFORT
Analysis settings for -effort:default.
|
static java.util.Set<java.lang.String> |
knownURLProtocolSet
Known URL protocols.
|
static AnalysisFeatureSetting[] |
LESS_EFFORT
Analysis settings for -effort:less.
|
static java.util.logging.Logger |
LOGGER |
static AnalysisFeatureSetting[] |
MAX_EFFORT
Analysis settings for -effort:max.
|
static AnalysisFeatureSetting[] |
MIN_EFFORT
Analysis settings for -effort:min.
|
static long |
MINIMUM_TIMESTAMP
Date of release of Java 1.0
|
static AnalysisFeatureSetting[] |
MORE_EFFORT
Analysis settings for -effort:more.
|
Constructor and Description |
---|
FindBugs() |
Modifier and Type | Method and Description |
---|---|
static BugReporter |
configureBaselineFilter(BugReporter bugReporter,
java.lang.String baselineFileName)
Configure a baseline bug instance filter.
|
static void |
configureBugCollection(IFindBugsEngine findBugs)
Configure the BugCollection (if the BugReporter being used is
constructing one).
|
static BugReporter |
configureFilter(BugReporter bugReporter,
java.lang.String filterFileName,
boolean include)
Configure the (bug instance) Filter for the given DelegatingBugReporter.
|
static void |
configureTrainingDatabases(IFindBugsEngine findBugs)
Configure training databases.
|
static java.lang.String |
getHome()
Get the FindBugs home directory.
|
static java.util.Set<java.lang.String> |
handleBugCategories(java.lang.String categories)
Process -bugCategories option.
|
static boolean |
isDetectorEnabled(IFindBugsEngine findBugs,
DetectorFactory factory,
int rankThreshold)
Determines whether or not given DetectorFactory should be enabled.
|
static boolean |
isNoAnalysis() |
static boolean |
isNoMains() |
static void |
processCommandLine(TextUICommandLine commandLine,
java.lang.String[] argv,
IFindBugsEngine findBugs)
Process the command line.
|
static void |
runMain(IFindBugsEngine findBugs,
TextUICommandLine commandLine)
Given a fully-configured IFindBugsEngine and the TextUICommandLine used
to configure it, execute the analysis.
|
static void |
setHome(java.lang.String home)
Set the FindBugs home directory.
|
static void |
setNoAnalysis()
Disable analysis within FindBugs.
|
static void |
setNoMains()
Disable loading of FindBugsMain classes.
|
static void |
showCommandLineOptions()
Print command line options synopses to stdout.
|
static void |
showCommandLineOptions(TextUICommandLine commandLine)
Print command line options synopses to stdout.
|
static void |
showHelp(TextUICommandLine commandLine)
Show -help message.
|
static void |
showSynopsis()
Show the overall FindBugs command synopsis.
|
static boolean |
validTimestamp(long timestamp) |
public static final AnalysisFeatureSetting[] MIN_EFFORT
public static final AnalysisFeatureSetting[] LESS_EFFORT
public static final AnalysisFeatureSetting[] DEFAULT_EFFORT
public static final AnalysisFeatureSetting[] MORE_EFFORT
public static final AnalysisFeatureSetting[] MAX_EFFORT
public static final boolean DEBUG
public static final java.util.logging.Logger LOGGER
@StaticConstant public static final java.util.Set<java.lang.String> knownURLProtocolSet
public static final long MINIMUM_TIMESTAMP
public static void setNoAnalysis()
public static boolean isNoAnalysis()
public static void setNoMains()
public static boolean isNoMains()
public static void setHome(java.lang.String home)
public static java.lang.String getHome()
public static void configureTrainingDatabases(IFindBugsEngine findBugs) throws java.io.IOException
findBugs
- the IFindBugsEngine to configurejava.io.IOException
public static boolean isDetectorEnabled(IFindBugsEngine findBugs, DetectorFactory factory, int rankThreshold)
findBugs
- the IFindBugsEnginefactory
- the DetectorFactoryrankThreshold
- TODOpublic static java.util.Set<java.lang.String> handleBugCategories(java.lang.String categories)
categories
- comma-separated list of bug categoriespublic static void processCommandLine(TextUICommandLine commandLine, java.lang.String[] argv, IFindBugsEngine findBugs) throws java.io.IOException, FilterException
commandLine
- the TextUICommandLine object which will parse the command lineargv
- the command line argumentsfindBugs
- the IFindBugsEngine to configurejava.io.IOException
FilterException
public static void showHelp(TextUICommandLine commandLine)
commandLine
- public static void runMain(IFindBugsEngine findBugs, TextUICommandLine commandLine) throws java.io.IOException
findBugs
- a fully-configured IFindBugsEnginecommandLine
- the TextUICommandLine used to configure the IFindBugsEnginejava.io.IOException
public static void showCommandLineOptions()
public static void showCommandLineOptions(TextUICommandLine commandLine)
commandLine
- the TextUICommandLine whose options should be printedpublic static void showSynopsis()
public static BugReporter configureFilter(BugReporter bugReporter, java.lang.String filterFileName, boolean include) throws java.io.IOException, FilterException
bugReporter
- a DelegatingBugReporterfilterFileName
- filter file nameinclude
- true if the filter is an include filter, false if it's an
exclude filterjava.io.IOException
FilterException
public static BugReporter configureBaselineFilter(BugReporter bugReporter, java.lang.String baselineFileName) throws java.io.IOException, org.dom4j.DocumentException
bugReporter
- a DelegatingBugReporterbaselineFileName
- filename of baseline Filterjava.io.IOException
org.dom4j.DocumentException
public static void configureBugCollection(IFindBugsEngine findBugs)
findBugs
- the IFindBugsEnginepublic static boolean validTimestamp(long timestamp)
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.