Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 additions & 1 deletion findbugs/findbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,49 @@ For a detailed description of findbugs bug categories, see http://findbugs.sourc
<Class name="~io.confluent.ksql.cli.console.Console"/>
<Bug pattern="FS_BAD_DATE_FORMAT_FLAG_COMBO"/>
</Match>
<!-- Targeted test exclusions: suppress common false positives in test code -->
<!-- Tests routinely store mutable objects and expose internal state by design -->
<Match>
<Class name="~.*Test" />
<Class name="~.*Test.*"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<Match>
<Class name="~.*Test.*"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="~.*Test.*"/>
<Bug pattern="MS_EXPOSE_REP"/>
</Match>
<!-- Tests often have inner classes that don't need to be static -->
<Match>
<Class name="~.*Test.*"/>
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC"/>
</Match>
<!-- Tests may compare floats directly for exact expected values -->
<Match>
<Class name="~.*Test.*"/>
<Bug pattern="FE_FLOATING_POINT_EQUALITY"/>
</Match>
<!-- Tests may use static fields that should be static (test fixtures) -->
<Match>
<Class name="~.*Test.*"/>
<Bug pattern="SS_SHOULD_BE_STATIC"/>
</Match>
<!-- Tests may use date format patterns that SpotBugs considers suspicious -->
<Match>
<Class name="~.*Test.*"/>
<Bug pattern="FS_BAD_DATE_FORMAT_FLAG_COMBO"/>
</Match>
<!-- Tests may intentionally test security manager methods -->
<Match>
<Class name="~.*Test.*"/>
<Bug pattern="VSC_VULNERABLE_SECURITY_CHECK_METHODS"/>
</Match>
<!-- Tests may create objects used only for side effects or assertions -->
<Match>
<Class name="~.*Test.*"/>
Comment on lines +103 to +141
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class regex ~.*Test.* matches any class name containing Test, not just test classes (e.g., io.confluent.ksql.test.TestFrameworkException lives under src/main/java). This broad match can unintentionally suppress SpotBugs findings in non-test / main-source code. If the intent is to cover test classes and their inner classes, consider tightening the pattern to something like “ends with Test” plus optional inner class suffix (e.g., ~.*Test($|\$.*)).

Suggested change
<Class name="~.*Test.*"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<Match>
<Class name="~.*Test.*"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="~.*Test.*"/>
<Bug pattern="MS_EXPOSE_REP"/>
</Match>
<!-- Tests often have inner classes that don't need to be static -->
<Match>
<Class name="~.*Test.*"/>
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC"/>
</Match>
<!-- Tests may compare floats directly for exact expected values -->
<Match>
<Class name="~.*Test.*"/>
<Bug pattern="FE_FLOATING_POINT_EQUALITY"/>
</Match>
<!-- Tests may use static fields that should be static (test fixtures) -->
<Match>
<Class name="~.*Test.*"/>
<Bug pattern="SS_SHOULD_BE_STATIC"/>
</Match>
<!-- Tests may use date format patterns that SpotBugs considers suspicious -->
<Match>
<Class name="~.*Test.*"/>
<Bug pattern="FS_BAD_DATE_FORMAT_FLAG_COMBO"/>
</Match>
<!-- Tests may intentionally test security manager methods -->
<Match>
<Class name="~.*Test.*"/>
<Bug pattern="VSC_VULNERABLE_SECURITY_CHECK_METHODS"/>
</Match>
<!-- Tests may create objects used only for side effects or assertions -->
<Match>
<Class name="~.*Test.*"/>
<Class name="~.*Test($|\$.*)"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<Match>
<Class name="~.*Test($|\$.*)"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="~.*Test($|\$.*)"/>
<Bug pattern="MS_EXPOSE_REP"/>
</Match>
<!-- Tests often have inner classes that don't need to be static -->
<Match>
<Class name="~.*Test($|\$.*)"/>
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC"/>
</Match>
<!-- Tests may compare floats directly for exact expected values -->
<Match>
<Class name="~.*Test($|\$.*)"/>
<Bug pattern="FE_FLOATING_POINT_EQUALITY"/>
</Match>
<!-- Tests may use static fields that should be static (test fixtures) -->
<Match>
<Class name="~.*Test($|\$.*)"/>
<Bug pattern="SS_SHOULD_BE_STATIC"/>
</Match>
<!-- Tests may use date format patterns that SpotBugs considers suspicious -->
<Match>
<Class name="~.*Test($|\$.*)"/>
<Bug pattern="FS_BAD_DATE_FORMAT_FLAG_COMBO"/>
</Match>
<!-- Tests may intentionally test security manager methods -->
<Match>
<Class name="~.*Test($|\$.*)"/>
<Bug pattern="VSC_VULNERABLE_SECURITY_CHECK_METHODS"/>
</Match>
<!-- Tests may create objects used only for side effects or assertions -->
<Match>
<Class name="~.*Test($|\$.*)"/>

Copilot uses AI. Check for mistakes.
<Bug pattern="UC_USELESS_OBJECT"/>
</Match>
<!--
DO NOT USE THIS EXCLUSION FILE FOR NON-GENERATED CODE
Expand Down
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,7 @@
<effort>Max</effort>
<threshold>Max</threshold>
<failOnError>true</failOnError>
<!-- <includeTests>true</includeTests>-->
<includeTests>true</includeTests>
</configuration>
<executions>
<!--
Expand All @@ -1546,6 +1546,13 @@
<goal>check</goal>
</goals>
</execution>
<execution>
<id>analyze-test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>

Expand Down