revert: undo SpotBugs and PMD exclusion changes

Reverting the broad exclusions added in the previous commits.
Will fix actual code issues instead of suppressing warnings.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Daniel SamsonandClaude Opus 4.5 committed 2026-01-22 02:02:27 +00:00
1 parent e92b067dc5
commit d0627a8ee6
2 files changed
+7 -143

No files matched your search

+7 -42
View File
@@ -21,12 +21,6 @@
<exclude name="JUnit4TestShouldUseTestAnnotation"/>
<exclude name="JUnit4TestShouldUseBeforeAnnotation"/>
<exclude name="JUnit4TestShouldUseAfterAnnotation"/>
<!-- Allow multiple asserts in unit tests -->
<exclude name="UnitTestContainsTooManyAsserts"/>
<!-- Some tests verify behavior without explicit assert -->
<exclude name="UnitTestShouldIncludeAssert"/>
<!-- Guard log statements not needed with SLF4J -->
<exclude name="GuardLogStatement"/>
</rule>
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod">
@@ -54,16 +48,6 @@
<exclude name="CommentDefaultAccessModifier"/>
<!-- Java 21+ has useful implicit classes -->
<exclude name="UnnecessaryFullyQualifiedName"/>
<!-- Test methods with getter-like names are fine -->
<exclude name="LinguisticNaming"/>
<!-- Local variables don't need final -->
<exclude name="LocalVariableCouldBeFinal"/>
<!-- Method args don't need final -->
<exclude name="MethodArgumentCouldBeFinal"/>
<!-- Allow var for local type inference -->
<exclude name="UseExplicitTypes"/>
<!-- Locale not needed for internal identifiers -->
<exclude name="UseLocaleWithCaseConversions"/>
</rule>
<rule ref="category/java/codestyle.xml/ClassNamingConventions">
@@ -76,12 +60,9 @@
<properties>
<property name="methodPattern" value="[a-z][a-zA-Z0-9]*"/>
<property name="nativePattern" value="[a-z][a-zA-Z0-9]*"/>
<!-- Allow underscores in JUnit 5 test methods for BDD naming -->
<property name="junit5TestPattern" value="[a-z][a-zA-Z0-9_]*"/>
</properties>
</rule>
<!-- ================================================================== -->
<!-- DESIGN -->
<!-- ================================================================== -->
@@ -99,12 +80,6 @@
<exclude name="ExcessiveClassLength"/>
<!-- Too strict for modern patterns -->
<exclude name="AvoidCatchingGenericException"/>
<!-- CognitiveComplexity too strict -->
<exclude name="CognitiveComplexity"/>
<!-- Singular fields are sometimes intentional -->
<exclude name="SingularField"/>
<!-- Simplify boolean returns - sometimes explicit is clearer -->
<exclude name="SimplifyBooleanReturns"/>
</rule>
<rule ref="category/java/design.xml/CyclomaticComplexity">
@@ -148,18 +123,13 @@
<exclude name="BeanMembersShouldSerialize"/>
<!-- Too strict -->
<exclude name="DataflowAnomalyAnalysis"/>
<!-- String constants in tests are fine -->
<exclude name="AvoidDuplicateLiterals"/>
<!-- Underscores in numeric literals not required -->
<exclude name="UseUnderscoresInNumericLiterals"/>
<!-- Instanceof in catch is sometimes needed -->
<exclude name="AvoidInstanceofChecksInCatchClause"/>
<!-- Assignment in operand is sometimes cleaner -->
<exclude name="AssignmentInOperand"/>
<!-- Stack trace is preserved when needed -->
<exclude name="PreserveStackTrace"/>
<!-- Literals in if conditions are readable -->
<exclude name="AvoidLiteralsInIfCondition"/>
</rule>
<rule ref="category/java/errorprone.xml/AvoidLiteralsInIfCondition">
<properties>
<property name="ignoreMagicNumbers" value="-1,0,1,2"/>
<property name="ignoreExpressions" value="true"/>
</properties>
</rule>
<!-- ================================================================== -->
@@ -179,11 +149,6 @@
<rule ref="category/java/performance.xml">
<!-- Modern JVM handles this well -->
<exclude name="AvoidInstantiatingObjectsInLoops"/>
<!-- StringBuilder micro-optimizations not needed -->
<exclude name="ConsecutiveAppendsShouldReuse"/>
<exclude name="ConsecutiveLiteralAppends"/>
<exclude name="AppendCharacterWithChar"/>
<exclude name="InsufficientStringBufferDeclaration"/>
</rule>
<!-- ================================================================== -->
-101
View File
@@ -29,47 +29,10 @@
<Or>
<Class name="~.*ProcessExecutor.*"/>
<Class name="~.*CommandRunner.*"/>
<Class name="~.*ServiceManager.*"/>
<Class name="~.*WindowsServiceManager.*"/>
<Class name="~.*SystemdManager.*"/>
<Class name="~.*LaunchdManager.*"/>
<Class name="~.*UsageCollector.*"/>
</Or>
<Bug pattern="COMMAND_INJECTION"/>
</Match>
<!-- CRLF injection in logs is not exploitable when logging internal values -->
<Match>
<Bug pattern="CRLF_INJECTION_LOGS"/>
</Match>
<!-- Allow \n in format strings for generating config files -->
<Match>
<Or>
<Class name="~.*LaunchdManager.*"/>
<Class name="~.*SystemdManager.*"/>
</Or>
<Bug pattern="VA_FORMAT_STRING_USES_NEWLINE"/>
</Match>
<!-- Non-localized case conversion is safe for internal identifiers -->
<Match>
<Bug pattern="DM_CONVERT_CASE"/>
</Match>
<!-- Unicode handling false positives for simple parsing -->
<Match>
<Bug pattern="IMPROPER_UNICODE"/>
</Match>
<!-- Allow exposing internal representation for data classes -->
<Match>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<Match>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<!-- Exclude false positives for try-with-resources -->
<Match>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
@@ -83,68 +46,4 @@
</Not>
</Match>
<!-- XML formatting with internal data is safe -->
<Match>
<Class name="~.*XmlFormatter.*"/>
<Bug pattern="POTENTIAL_XML_INJECTION"/>
</Match>
<!-- Catching Exception is intentional for resilience -->
<Match>
<Bug pattern="REC_CATCH_EXCEPTION"/>
</Match>
<!-- Using TEMP env var is intentional for Windows compatibility -->
<Match>
<Class name="~.*ConfigDefaults.*"/>
<Bug pattern="ENV_USE_PROPERTY_INSTEAD_OF_ENV"/>
</Match>
<!-- Lazy init of static field is acceptable for OS detection -->
<Match>
<Class name="~.*OperatingSystem.*"/>
<Bug pattern="LI_LAZY_INIT_STATIC"/>
</Match>
<!-- Constructor throws are acceptable for validation -->
<Match>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<!-- Null checks - these are handled or acceptable -->
<Match>
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE"/>
</Match>
<!-- Ignoring executor submit return value is intentional -->
<Match>
<Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"/>
</Match>
<!-- Stream handling in IPC is managed correctly -->
<Match>
<Or>
<Class name="~.*IpcClient.*"/>
<Class name="~.*IpcServer.*"/>
</Or>
<Bug pattern="OS_OPEN_STREAM"/>
</Match>
<!-- ThreadLocalRandom is fine for jitter, not crypto -->
<Match>
<Class name="~.*RetryCalculator.*"/>
<Bug pattern="PREDICTABLE_RANDOM"/>
</Match>
<!-- Default encoding in UsageCollector is acceptable -->
<Match>
<Class name="~.*UsageCollector.*"/>
<Bug pattern="DM_DEFAULT_ENCODING"/>
</Match>
<!-- Throwing RuntimeException is intentional -->
<Match>
<Bug pattern="THROWS_METHOD_THROWS_RUNTIMEEXCEPTION"/>
</Match>
</FindBugsFilter>