Skip to content

chore: clean up detekt baseline (124 → 12 issues)#231

Merged
delebedev merged 1 commit intomainfrom
chore/detekt-baseline-cleanup
Mar 23, 2026
Merged

chore: clean up detekt baseline (124 → 12 issues)#231
delebedev merged 1 commit intomainfrom
chore/detekt-baseline-cleanup

Conversation

@klavdia-star
Copy link
Collaborator

Closes #6

Summary

Reduces detekt baseline from 124 → 12 unsuppressed issues. The remaining 12 are real refactors (long methods, long parameter lists) that need separate work.

Code fixes (~15 issues removed)

  • Remove dead GameBootstrap.addCardToZone private method
  • Remove unused GameLoopController.onStateChanged constructor param
  • Replace throw IllegalArgumentException with require() (DeckLoader, WebGuiGame)
  • Replace throw IllegalStateException with checkNotNull() (InteractivePromptBridge)
  • Use IllegalStateException instead of RuntimeException (GameBridge puzzle apply)
  • Log swallowed exception in InteractivePromptBridge catch block
  • Comment out orphaned isSendAndRecord val (InvariantChecker TODO code)

Suppressions with reasons (~85 issues → ManuallySuppressedIssues)

  • Unused loggers kept for future use
  • Visitor pattern ReturnCount (idiomatic early exits)
  • Protocol dispatch CyclomaticComplexMethod (inherent branching)
  • Wire-format ConstructorParameterNaming (CardsBlob mirrors Arena JSON)
  • LobbyStubs FunctionOnlyReturningConstant (intentional stub endpoints)
  • MaxLineLength in test JSON assertions and debug prints
  • UnusedParameter where interface/override contracts require the signature
  • SwallowedException where cause IS forwarded

Remaining 12 (deferred)

  • LongMethod: ActionMapper, MatchSession, StateMapper, WebCostDecision, RecordingCli
  • LongParameterList: GsmBuilder, ZoneMapper, FrontDoorHandler, SemanticTimelineTest
  • UnusedParameter: MatchmakingService.playerId

All 796 tests pass. Detekt + spotless clean.

Code fixes:
- Remove dead GameBootstrap.addCardToZone private method
- Remove unused GameLoopController.onStateChanged param
- Replace throw IllegalArgumentException with require() (DeckLoader, WebGuiGame)
- Replace throw IllegalStateException with checkNotNull() (InteractivePromptBridge)
- Use IllegalStateException instead of RuntimeException (GameBridge puzzle apply)
- Log swallowed exception in InteractivePromptBridge catch block
- Comment out unused isSendAndRecord val in InvariantChecker (TODO code)

Suppressions with reasons:
- Unused loggers kept for future use (@Suppress on property)
- Visitor pattern ReturnCount, protocol dispatch CyclomaticComplexMethod
- Wire-format ConstructorParameterNaming (CardsBlob)
- LobbyStubs FunctionOnlyReturningConstant (intentional protocol stubs)
- MaxLineLength in test JSON assertions and debug prints
- UnusedParameter where interface/override contracts require the signature
- SwallowedException where cause IS forwarded (GameBridge, DebugServer)

Remaining 12 baseline issues are real refactors (LongMethod, LongParameterList)
that need separate work to extract helpers / introduce param objects.
@github-actions
Copy link

Test Results

  242 files  ±0  242 suites  ±0   1m 58s ⏱️ -7s
1 006 tests ±0  980 ✅ ±0   26 💤 ±0  0 ❌ ±0 
1 795 runs  ±0  995 ✅ ±0  800 💤 ±0  0 ❌ ±0 

Results for commit bc1aaea. ± Comparison against base commit d908420.

@github-actions
Copy link

CI Report — Gate

Tests: 825/825 passed (190 skipped)

Coverage: 11.0% (642/5861 lines)

Module Coverage Lines
tooling 🔴 11% 642/5861
Slow tests (>3s): 1
  • InstanceIdReallocTest.Limbo grows across multiple plays (5.6s)

@delebedev delebedev merged commit da6ad8a into main Mar 23, 2026
4 checks passed
@delebedev delebedev deleted the chore/detekt-baseline-cleanup branch March 23, 2026 22:19
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.

Review and fix detekt baseline issues (124)

2 participants