SpongeBugs
SpongeBugs: Automatically Generating Fix Suggestions for SonarQube / SpotBugs
Install / Use
/learn @dvmarcilio/SpongeBugsREADME
SpongeBugs
Automatically fixing SonarQube and SpotBugs Java rules with source-to-source transformations.
SonarQube Target Rules
Bugs
Code Smells
- String literals should not be duplicated
- String function use should be optimized for single characters
- Strings should not be concatenated using '+' in a loop
- Parsing should be used to convert "Strings" to primitives
- Strings literals should be placed on the left side when checking for equality
- Constructors should not be used to instantiate "String", "BigInteger", "BigDecimal" and primitive-wrapper classes
- "entrySet()" should be iterated when both the key and value are needed
- Collection.isEmpty() should be used to test for emptiness
- "Collections.EMPTY_LIST", "EMPTY_MAP", and "EMPTY_SET" should not be used
Running
Please download the runnable.jar.
For a quickstart with default settings (all rules and ignoring test files):
java -jar spongebugs-runner-2.0.0.jar /tmp/project/path/src
Please make sure that your java points to a JDK (version >= 8).
You can pass several path arguments to the jar, including directories and .java files. Make sure to provide full paths.
For more advanced settings, such as including/excluding specific rules, or to not ignore test files, refer to RUNNING.md.
Research paper
SpongeBugs is an outcome of a research paper.
The pre-print is available at https://dvmarcilio.github.io/papers/jss20-spongebugs.pdf.
A list of Pull-Requests submitted to open-source projects is available at EVALUATION.md.
@article{DBLP:journals/jss/MarcilioFBP20,
author = {Diego Marcilio and
Carlo A. Furia and
Rodrigo Bonif{\'{a}}cio and
Gustavo Pinto},
title = {SpongeBugs: Automatically generating fix suggestions in response to
static code analysis warnings},
journal = {J. Syst. Softw.},
volume = {168},
pages = {110671},
year = {2020},
url = {https://doi.org/10.1016/j.jss.2020.110671},
doi = {10.1016/j.jss.2020.110671},
timestamp = {Thu, 10 Sep 2020 09:33:17 +0200},
biburl = {https://dblp.org/rec/journals/jss/MarcilioFBP20.bib},
bibsource = {dblp computer science bibliography, https://dblp.org}
}
Related Skills
node-connect
345.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
106.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
