MCPcopy Index your code
hub / github.com/spotbugs/spotbugs

github.com/spotbugs/spotbugs @4.10.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release 4.10.2 ↗ · + Follow
24,838 symbols 78,098 edges 3,549 files 4,550 documented · 18% 6 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

SpotBugs

Build Status Documentation Status Coverage Status Maven Central Javadocs

SpotBugs is the spiritual successor of FindBugs, carrying on from the point where it left off with support of its community.

SpotBugs is licensed under the GNU LESSER GENERAL PUBLIC LICENSE.

More information at the official website. A lot of things can still be found at the old FindBugs website.

Build

SpotBugs is built using Gradle. The recommended way to obtain it is to simply run the gradlew (or gradlew.bat) wrapper, which will automatically download and run the correct version as needed (using the settings in gradle/wrapper/gradle-wrapper.properties).

Building SpotBugs requires JDK 21 to run all the tests (using SpotBugs requires JDK 11 or above, but it can analyze code compiled with older versions).

To see a list of build options, run gradle tasks (or gradlew tasks). The build task will perform a full build and test.

To build the SpotBugs plugin for Eclipse, you'll need to create the file eclipsePlugin/local.properties, containing a property eclipseRoot.dir that points to an Eclipse installation's root directory (see .github/workflows/release.yaml for an example), then run the build. To prepare Eclipse environment only, run ./gradlew eclipse. See also detailed steps.

Using SpotBugs

SpotBugs can be used standalone and through several integrations, including:

Questions?

You can contact us using GitHub Discussions.

Extension points exported contracts — how you extend this code

FindBugsProgress (Interface)
A callback that may be installed in a FindBugs instance to asynchronously keep track of its progress. @author David Hov [8 …
spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugsProgress.java
RunnableWithExceptions (Interface)
(no doc) [96 implementers]
spotbugs-tests/src/test/java/edu/umd/cs/findbugs/RunnableWithExceptions.java
MyInterface (Interface)
(no doc) [145 implementers]
spotbugsTestCases/src/java21/Issue2782.java
ExpectedViewElement (Interface)
Interface for expected view elements. An expected view element is an object created by a test case that sets the expecta [4 …
eclipsePlugin-test/src/de/tobject/findbugs/view/test/ExpectedViewElement.java
ApplicabilityVisitor (Interface)
This visitor should traverse the AST as much as needed to determine the nature of the replacement string, and then retur [3 …
eclipsePlugin/src/edu/umd/cs/findbugs/plugin/eclipse/quickfix/ApplicabilityVisitor.java
BugAnnotation (Interface)
An object providing context information about a particular BugInstance. A custom bug annotation can implement a stat [11 …
spotbugs/src/main/java/edu/umd/cs/findbugs/BugAnnotation.java
A (Interface)
(no doc) [105 implementers]
spotbugsTestCases/src/java/EqualsComparison.java
IPathElement (Interface)
(no doc) [4 implementers]
eclipsePlugin/src/de/tobject/findbugs/properties/IPathElement.java

Core symbols most depended-on inside this repo

add
called by 12952
spotbugs/src/main/java/edu/umd/cs/findbugs/BugCollection.java
equals
called by 1424
spotbugs/src/main/java/edu/umd/cs/findbugs/detect/Stream.java
println
called by 1374
spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/Debug.java
get
called by 1318
spotbugsTestCases/src/java/sfBugs/Bug3483863.java
getName
called by 828
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassMember.java
contains
called by 645
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceFinder.java
toString
called by 627
spotbugs/src/main/java/edu/umd/cs/findbugs/BugAnnotation.java
getClassName
called by 551
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/ClassMember.java

Shape

Method 19,695
Class 4,826
Interface 213
Enum 93
Function 11

Languages

Java100%
Python1%
Kotlin1%

Modules by API surface

spotbugsTestCases/src/java/npe/EclipseNullReferenceTestCases.java1,070 symbols
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AbstractFrameModelingVisitor.java200 symbols
spotbugs/src/main/java/edu/umd/cs/findbugs/OpcodeStack.java154 symbols
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/TypeFrameModelingVisitor.java128 symbols
spotbugs/src/main/java/edu/umd/cs/findbugs/BugInstance.java128 symbols
spotbugs/src/gui/main/edu/umd/cs/findbugs/gui2/MainFrame.java97 symbols
spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/analysis/MethodInfo.java83 symbols
spotbugs/src/main/java/edu/umd/cs/findbugs/detect/FindRefComparison.java81 symbols
spotbugs/src/main/java/edu/umd/cs/findbugs/SortedBugCollection.java81 symbols
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/AnalysisContext.java77 symbols
spotbugs/src/main/java/edu/umd/cs/findbugs/Plugin.java72 symbols
spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/engine/bcel/ValueRangeAnalysisFactory.java70 symbols

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add spotbugs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page