What are some useful static analyzers for Java?

This page summarizes the projects mentioned and recommended in the original post on /r/java

Our great sponsors
  • Sonar - Write Clean Java Code. Always.
  • InfluxDB - Access the most powerful time series database as a service
  • SaaSHub - Software Alternatives and Reviews
  • Spotbugs

    SpotBugs is FindBugs' successor. A tool for static analysis to look for bugs in Java code.

  • find-sec-bugs

    The SpotBugs plugin for security audits of Java web applications and Android applications. (Also work with Kotlin, Groovy and Scala projects)

    SpotBugs have a lot of extensions such as https://find-sec-bugs.github.io/ https://github.com/KengoTODA/findbugs-slf4j and more, I recommend adding them as well

  • Sonar

    Write Clean Java Code. Always.. Sonar helps you commit clean code every time. With over 600 unique rules to find Java bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work.

  • gradle-errorprone-plugin

    Gradle plugin to use the error-prone compiler for Java

    In personal projects, I've had good experiences using the error-prone compiler plugin with uber's nullaway.

  • NullAway

    A tool to help eliminate NullPointerExceptions (NPEs) in your Java code with low build-time overhead

    In personal projects, I've had good experiences using the error-prone compiler plugin with uber's nullaway.

  • forbidden-apis

    Policeman's Forbidden API Checker

    Besides the classic pmd/stopbugs/jacoco/owasp, a favorite of mine is forbidden-apis.

  • findbugs-slf4j

    A SpotBugs/FindBugs plugin to verify usage of SLF4J

    SpotBugs have a lot of extensions such as https://find-sec-bugs.github.io/ https://github.com/KengoTODA/findbugs-slf4j and more, I recommend adding them as well

  • fb-contrib

    a FindBugs/SpotBugs plugin for doing static code analysis for java code bases

    and https://github.com/mebigfatguy/fb-contrib

  • InfluxDB

    Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts