spotbugs/spotbugs

GitHub: spotbugs/spotbugs

SpotBugs 是 FindBugs 的继任者,通过静态分析 Java 字节码来检测代码缺陷和潜在安全问题。

Stars: 3830 | Forks: 648

# ![SpotBugs](https://spotbugs.github.io/images/logos/spotbugs_logo_300px.png) [![Build Status](https://static.pigsec.cn/wp-content/uploads/repos/2026/02/6a772cb348112346.svg)](https://github.com/spotbugs/spotbugs/actions) [![Documentation Status](https://readthedocs.org/projects/spotbugs/badge/?version=latest)](https://spotbugs.readthedocs.io/en/latest/?badge=latest) [![Coverage Status](https://sonarcloud.io/api/project_badges/measure?branch=master&project=com.github.spotbugs.spotbugs&metric=coverage)](https://sonarcloud.io/component_measures?id=com.github.spotbugs.spotbugs&metric=coverage) [![Maven Central](https://img.shields.io/maven-central/v/com.github.spotbugs/spotbugs)](https://central.sonatype.com/artifact/com.github.spotbugs/spotbugs) [![Javadocs](https://javadoc.io/badge/com.github.spotbugs/spotbugs.svg)](https://javadoc.io/doc/com.github.spotbugs/spotbugs) [SpotBugs](https://spotbugs.github.io/) 是 [FindBugs](https://github.com/findbugsproject/findbugs) 的精神继承者,在其停止的地方继续发展,并得到了社区的支持。 SpotBugs 基于 [GNU LESSER GENERAL PUBLIC LICENSE](https://github.com/spotbugs/spotbugs/blob/master/spotbugs/licenses/LICENSE.txt) 授权。 更多信息请访问 [official website](https://spotbugs.github.io/)。许多内容仍然可以在 [old FindBugs website](https://findbugs.sourceforge.net) 找到。 # 构建 SpotBugs 使用 [Gradle](https://gradle.org) 构建。推荐的获取方式是直接运行 `gradlew`(或 `gradlew.bat`)包装器,它会根据需要自动下载并运行正确的版本(使用 `gradle/wrapper/gradle-wrapper.properties` 中的设置)。 构建 SpotBugs 需要 JDK 21 来运行所有测试(使用 SpotBugs 需要 JDK 11 或更高版本,但它可以分析使用旧版本编译的代码)。 要查看构建选项列表,请运行 `gradle tasks`(或 `gradlew tasks`)。`build` 任务将执行完整的构建和测试。 要构建 SpotBugs 的 Eclipse 插件,你需要创建文件 `eclipsePlugin/local.properties`,其中包含一个指向 Eclipse 安装根目录的属性 `eclipseRoot.dir`(示例请参见 `.github/workflows/release.yml`),然后运行构建。 如果仅需准备 Eclipse 环境,请运行 `./gradlew eclipse`。另请参阅 [detailed steps](https://github.com/spotbugs/spotbugs/blob/master/eclipsePlugin/doc/building_spotbugs_plugin.txt)。 # 使用 SpotBugs SpotBugs 可以独立使用,也可以通过多种集成方式使用,包括: * [Ant](https://spotbugs.readthedocs.io/en/latest/ant.html) * [Maven](https://spotbugs.readthedocs.io/en/latest/maven.html) * [Gradle](https://spotbugs.readthedocs.io/en/latest/gradle.html) * [Eclipse](https://spotbugs.readthedocs.io/en/latest/eclipse.html) * [Sonarqube](https://github.com/spotbugs/sonar-findbugs) * [IntelliJ IDEA](https://github.com/JetBrains/spotbugs-intellij-plugin) # 有问题? 你可以通过 [GitHub Discussions](https://github.com/spotbugs/spotbugs/discussions) 联系我们。
标签:AST分析, Bug查找, CVE防护, FindBugs, Gradle, GUI应用, Java, JS文件枚举, LNA, pip安装, SDLC, SpotBugs, TLS抓取, TXT输出, Web界面, 中间件漏洞, 二进制发布, 代码审计, 代码质量, 函数图谱, 口令爆破, 后台面板检测, 域名枚举, 域名枚举, 域名枚举, 域名枚举, 安全专业人员, 带宽管理, 开源工具, 弱口令检测, 横向移动, 漏洞检测, 漏洞测试, 用户界面自定义, 知道创宇, 编程规范, 资源监视器, 软件安全, 错误基检测, 静态代码分析