Skip to content

chore: clear a batch of Sonar findings#12

Merged
dfa1 merged 1 commit into
mainfrom
chore/sonar-cleanups
Jun 26, 2026
Merged

chore: clear a batch of Sonar findings#12
dfa1 merged 1 commit into
mainfrom
chore/sonar-cleanups

Conversation

@dfa1

@dfa1 dfa1 commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Clears ~25 SonarCloud findings, no behaviour change.

  • ignored → unnamed _ — the size_t status from native free() and swallowed destructor Throwables are intentionally discarded; unnamed variables say so and drop the dead-store/unused-local noise (S1854 ×8, S1481 ×8, S7467 ×3).
  • benchmark excluded from analysis — JMH harness, not shipped runtime; its @Setup/@TearDown lifecycle trips a false "resource not closed" (S2095). Already excluded from coverage.
  • C-struct comments reworded — prose instead of {...} shapes so they aren't parsed as commented-out code (S125 ×3).
  • ZDICT field-name constantsFIELD_NB_THREADS / FIELD_COMPRESSION_LEVEL instead of repeated literals (S1192 ×2).

Deferred (separate concerns): S7474/S6213/S2187 (clash with documented ///-markdown + @Nested conventions), S112 (throws Throwable is forced by FFM invokeExact), S5443 (temp dir already owner-only), S7637 (workflow action SHA pinning — better via Dependabot), S3776 (a real refactor).

Test

./mvnw -pl zstd,benchmark -am verify — 138 green, checkstyle + javadoc clean.

🤖 Generated with Claude Code

- Discard unused size_t status from native free() calls and swallowed
  destructor throwables via unnamed variables `_` instead of `ignored`
  (S1854 / S1481 / S7467).
- Exclude the benchmark module from Sonar analysis: it is a JMH harness,
  not shipped runtime, and its @Setup/@teardown lifecycle trips a false
  "resource not closed" report (S2095).
- Reword the C-struct reference comments to prose so they are not parsed
  as commented-out code (S125).
- Extract the repeated ZDICT field-name literals into constants (S1192).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dfa1 dfa1 merged commit 21a9ab4 into main Jun 26, 2026
1 check passed
@dfa1 dfa1 deleted the chore/sonar-cleanups branch June 26, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant