Archived
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:
1 parent
e92b067dc5
commit
d0627a8ee6
2 files changed
+7
-143
No files matched your search
+7
-42
@@ -21,12 +21,6 @@
|
|||||||
<exclude name="JUnit4TestShouldUseTestAnnotation"/>
|
<exclude name="JUnit4TestShouldUseTestAnnotation"/>
|
||||||
<exclude name="JUnit4TestShouldUseBeforeAnnotation"/>
|
<exclude name="JUnit4TestShouldUseBeforeAnnotation"/>
|
||||||
<exclude name="JUnit4TestShouldUseAfterAnnotation"/>
|
<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>
|
||||||
|
|
||||||
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod">
|
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod">
|
||||||
@@ -54,16 +48,6 @@
|
|||||||
<exclude name="CommentDefaultAccessModifier"/>
|
<exclude name="CommentDefaultAccessModifier"/>
|
||||||
<!-- Java 21+ has useful implicit classes -->
|
<!-- Java 21+ has useful implicit classes -->
|
||||||
<exclude name="UnnecessaryFullyQualifiedName"/>
|
<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>
|
||||||
|
|
||||||
<rule ref="category/java/codestyle.xml/ClassNamingConventions">
|
<rule ref="category/java/codestyle.xml/ClassNamingConventions">
|
||||||
@@ -76,12 +60,9 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<property name="methodPattern" value="[a-z][a-zA-Z0-9]*"/>
|
<property name="methodPattern" value="[a-z][a-zA-Z0-9]*"/>
|
||||||
<property name="nativePattern" 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>
|
</properties>
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
|
|
||||||
<!-- ================================================================== -->
|
<!-- ================================================================== -->
|
||||||
<!-- DESIGN -->
|
<!-- DESIGN -->
|
||||||
<!-- ================================================================== -->
|
<!-- ================================================================== -->
|
||||||
@@ -99,12 +80,6 @@
|
|||||||
<exclude name="ExcessiveClassLength"/>
|
<exclude name="ExcessiveClassLength"/>
|
||||||
<!-- Too strict for modern patterns -->
|
<!-- Too strict for modern patterns -->
|
||||||
<exclude name="AvoidCatchingGenericException"/>
|
<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>
|
||||||
|
|
||||||
<rule ref="category/java/design.xml/CyclomaticComplexity">
|
<rule ref="category/java/design.xml/CyclomaticComplexity">
|
||||||
@@ -148,18 +123,13 @@
|
|||||||
<exclude name="BeanMembersShouldSerialize"/>
|
<exclude name="BeanMembersShouldSerialize"/>
|
||||||
<!-- Too strict -->
|
<!-- Too strict -->
|
||||||
<exclude name="DataflowAnomalyAnalysis"/>
|
<exclude name="DataflowAnomalyAnalysis"/>
|
||||||
<!-- String constants in tests are fine -->
|
</rule>
|
||||||
<exclude name="AvoidDuplicateLiterals"/>
|
|
||||||
<!-- Underscores in numeric literals not required -->
|
<rule ref="category/java/errorprone.xml/AvoidLiteralsInIfCondition">
|
||||||
<exclude name="UseUnderscoresInNumericLiterals"/>
|
<properties>
|
||||||
<!-- Instanceof in catch is sometimes needed -->
|
<property name="ignoreMagicNumbers" value="-1,0,1,2"/>
|
||||||
<exclude name="AvoidInstanceofChecksInCatchClause"/>
|
<property name="ignoreExpressions" value="true"/>
|
||||||
<!-- Assignment in operand is sometimes cleaner -->
|
</properties>
|
||||||
<exclude name="AssignmentInOperand"/>
|
|
||||||
<!-- Stack trace is preserved when needed -->
|
|
||||||
<exclude name="PreserveStackTrace"/>
|
|
||||||
<!-- Literals in if conditions are readable -->
|
|
||||||
<exclude name="AvoidLiteralsInIfCondition"/>
|
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<!-- ================================================================== -->
|
<!-- ================================================================== -->
|
||||||
@@ -179,11 +149,6 @@
|
|||||||
<rule ref="category/java/performance.xml">
|
<rule ref="category/java/performance.xml">
|
||||||
<!-- Modern JVM handles this well -->
|
<!-- Modern JVM handles this well -->
|
||||||
<exclude name="AvoidInstantiatingObjectsInLoops"/>
|
<exclude name="AvoidInstantiatingObjectsInLoops"/>
|
||||||
<!-- StringBuilder micro-optimizations not needed -->
|
|
||||||
<exclude name="ConsecutiveAppendsShouldReuse"/>
|
|
||||||
<exclude name="ConsecutiveLiteralAppends"/>
|
|
||||||
<exclude name="AppendCharacterWithChar"/>
|
|
||||||
<exclude name="InsufficientStringBufferDeclaration"/>
|
|
||||||
</rule>
|
</rule>
|
||||||
|
|
||||||
<!-- ================================================================== -->
|
<!-- ================================================================== -->
|
||||||
|
|||||||
@@ -29,47 +29,10 @@
|
|||||||
<Or>
|
<Or>
|
||||||
<Class name="~.*ProcessExecutor.*"/>
|
<Class name="~.*ProcessExecutor.*"/>
|
||||||
<Class name="~.*CommandRunner.*"/>
|
<Class name="~.*CommandRunner.*"/>
|
||||||
<Class name="~.*ServiceManager.*"/>
|
|
||||||
<Class name="~.*WindowsServiceManager.*"/>
|
|
||||||
<Class name="~.*SystemdManager.*"/>
|
|
||||||
<Class name="~.*LaunchdManager.*"/>
|
|
||||||
<Class name="~.*UsageCollector.*"/>
|
|
||||||
</Or>
|
</Or>
|
||||||
<Bug pattern="COMMAND_INJECTION"/>
|
<Bug pattern="COMMAND_INJECTION"/>
|
||||||
</Match>
|
</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 -->
|
<!-- Exclude false positives for try-with-resources -->
|
||||||
<Match>
|
<Match>
|
||||||
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
|
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
|
||||||
@@ -83,68 +46,4 @@
|
|||||||
</Not>
|
</Not>
|
||||||
</Match>
|
</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>
|
</FindBugsFilter>
|
||||||
Reference in new issue
Block a user