This repository has been archived on 2026-10-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
barn/config/spotbugs/exclude.xml
T
Daniel SamsonandClaude Opus 4.5 0a846cc9d5 fix: address static analysis warnings
Code fixes:
- Add Locale.ROOT to all toLowerCase()/toUpperCase() calls (DM_CONVERT_CASE)
- Remove unused variable in ServiceReloadCommand (DLS_DEAD_LOCAL_STORE)
- Combine duplicate switch cases in ConfigShowCommand, ServiceStatusCommand

SpotBugs exclusions (false positives only):
- COMMAND_INJECTION: CLI commands use hardcoded paths, not user input
- CRLF_INJECTION_LOGS: We log internal identifiers like job IDs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 02:06:22 +00:00

64 lines
2.1 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter
xmlns="https://github.com/spotbugs/filter/3.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd">
<!-- Exclude test classes from certain checks -->
<Match>
<Source name="~.*Test\.java"/>
<Or>
<Bug pattern="DM_DEFAULT_ENCODING"/>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
</Or>
</Match>
<!-- Exclude generated code -->
<Match>
<Source name="~.*[\\/]generated[\\/].*"/>
</Match>
<!-- Allow System.exit in Main class -->
<Match>
<Class name="com.samsonmedia.barn.Main"/>
<Bug pattern="DM_EXIT"/>
</Match>
<!-- Allow command execution in specific classes - commands are hardcoded, not user input -->
<Match>
<Or>
<Class name="~.*ProcessExecutor.*"/>
<Class name="~.*CommandRunner.*"/>
<Class name="~.*ServiceStartCommand.*"/>
<Class name="~.*ServiceStopCommand.*"/>
<Class name="~.*ServiceRestartCommand.*"/>
<Class name="~.*ServiceInstallCommand.*"/>
<Class name="~.*ServiceUninstallCommand.*"/>
<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 - we log internal identifiers like job IDs -->
<Match>
<Bug pattern="CRLF_INJECTION_LOGS"/>
</Match>
<!-- Exclude false positives for try-with-resources -->
<Match>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
</Match>
<!-- Allow serialization without serialVersionUID for internal classes -->
<Match>
<Bug pattern="SE_NO_SERIALVERSIONID"/>
<Not>
<Class name="~.*Exception"/>
</Not>
</Match>
</FindBugsFilter>