Skip to content

Commit

Permalink
Fine-grained SpotBugs exclusions (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Mar 9, 2022
1 parent 7d5e8e9 commit a38b111
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<gitHubRepo>jenkinsci/lib-${project.artifactId}</gitHubRepo>
<asm.version>9.2</asm.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spotbugs.skip>true</spotbugs.skip> <!-- TODO lots of violations -->
<spotbugs.excludeFilterFile>${project.basedir}/src/spotbugs/spotbugs-excludes.xml</spotbugs.excludeFilterFile>
</properties>

<scm>
Expand Down
72 changes: 72 additions & 0 deletions src/spotbugs/spotbugs-excludes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<!--
Exclusions in this section have been triaged and determined to be false positives.
-->
<Match>
<Or>
<!-- Pending https://github.com/spotbugs/spotbugs/issues/1515 -->
<Bug pattern="DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED"/>
</Or>
</Match>
<!--
Here lies technical debt. Exclusions in this section have not yet been triaged. When working on
on this section, pick an exclusion to triage, then:
- If it is a false positive, add a @SuppressFBWarnings(value = "[…]", justification = "[…]")
annotation indicating the reason why it is a false positive, then remove the exclusion from
this section.
- If it is not a false positive, fix the bug, then remove the exclusion from this section.
-->
<Match>
<Confidence value="1"/>
<Or>
<And>
<Bug pattern="DM_DEFAULT_ENCODING"/>
<Or>
<Class name="org.kohsuke.file_leak_detector.AgentMain"/>
<Class name="org.kohsuke.file_leak_detector.AgentMain$3$1"/>
<Class name="org.kohsuke.file_leak_detector.Listener"/>
</Or>
</And>
</Or>
</Match>
<Match>
<Confidence value="2"/>
<Or>
<And>
<Bug pattern="MS_MUTABLE_COLLECTION_PKGPROTECT"/>
<Class name="org.kohsuke.file_leak_detector.Listener"/>
</And>
<And>
<Bug pattern="MS_PKGPROTECT"/>
<Class name="org.kohsuke.file_leak_detector.Listener"/>
</And>
<And>
<Bug pattern="PATH_TRAVERSAL_IN"/>
<Or>
<Class name="org.kohsuke.file_leak_detector.AgentMain"/>
<Class name="org.kohsuke.file_leak_detector.Main"/>
</Or>
</And>
<And>
<Bug pattern="PATH_TRAVERSAL_OUT"/>
<Class name="org.kohsuke.file_leak_detector.AgentMain"/>
</And>
<And>
<Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"/>
<Or>
<Class name="org.kohsuke.file_leak_detector.AgentMain"/>
<Class name="org.kohsuke.file_leak_detector.AgentMain$3"/>
</Or>
</And>
<And>
<Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT"/>
<Class name="org.kohsuke.file_leak_detector.AgentMain"/>
</And>
<And>
<Bug pattern="UNENCRYPTED_SERVER_SOCKET"/>
<Class name="org.kohsuke.file_leak_detector.AgentMain"/>
</And>
</Or>
</Match>
</FindBugsFilter>

0 comments on commit a38b111

Please sign in to comment.