Skip to content

refactor(detekt): remove baseline and fix existing findings#36

Merged
eltonvs merged 2 commits intomasterfrom
codex/detekt-baseline-burndown
Feb 24, 2026
Merged

refactor(detekt): remove baseline and fix existing findings#36
eltonvs merged 2 commits intomasterfrom
codex/detekt-baseline-burndown

Conversation

@eltonvs
Copy link
Owner

@eltonvs eltonvs commented Feb 24, 2026

Summary

  • remove detekt baseline usage and delete
  • keep detekt config minimal and rely on default rules
  • refactor source/tests to address existing detekt issues instead of suppressing them
  • rename files to satisfy matching declaration-name checks

Validation

  • ./gradlew --no-daemon clean test ktlintCheck detekt

Notes

  • no or local environment files included

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 24, 2026

Greptile Summary

This PR removes the detekt baseline file and systematically refactors the codebase to address all previously suppressed detekt issues.

Key changes:

  • Removed detekt-baseline.xml (137 suppressed issues) and baseline configuration from build.gradle.kts
  • Renamed files to match class names (RegexUtils.ktRegexPatterns.kt, etc.)
  • Replaced all magic numbers with named constants throughout the codebase
  • Changed implicit it lambda parameters to descriptive names (response, value, etc.)
  • Refactored FuelTypeCommand.getFuelType() from a when-expression to a map-based lookup
  • Fixed LoopWithTooManyJumpStatements in ObdDeviceConnection.kt by using a boolean flag instead of multiple breaks
  • Extracted test data arrays to top-level constants for better readability

The refactoring improves code maintainability without changing behavior. All changes follow Kotlin best practices and standard detekt rules.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Pure refactoring PR that improves code quality without changing behavior. Changes are systematic (magic numbers → constants, it → descriptive names, file renames for consistency), verified by passing tests and detekt validation. No logic changes, only readability improvements.
  • No files require special attention

Important Files Changed

Filename Overview
build.gradle.kts Removed baseline configuration to enable active detekt enforcement
detekt-baseline.xml Deleted 137-line baseline file that suppressed detekt issues
src/main/kotlin/com/github/eltonvs/obd/command/control/TroubleCodes.kt Extracted constants for DTC parsing logic and improved readability
src/main/kotlin/com/github/eltonvs/obd/command/fuel/Fuel.kt Replaced large when-expression with map and extracted fuel code constants
src/main/kotlin/com/github/eltonvs/obd/connection/ObdDeviceConnection.kt Refactored while loop to eliminate multiple break statements
src/test/kotlin/com/github/eltonvs/obd/command/control/AvailableCommands.kt Extracted test data into top-level constants for readability

Last reviewed commit: 1947f78

@eltonvs eltonvs merged commit 7c0f6a8 into master Feb 24, 2026
2 checks passed
@eltonvs eltonvs deleted the codex/detekt-baseline-burndown branch February 24, 2026 08:18
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