Repository navigation
refactor: remove dead code, duplication and high-complexity functions - #167
Merged
Merged
Conversation
- Delete functions unreachable from main; move test-only hooks into test files and point tests of thin wrappers at the real function. - Show the Docker socket help message when the daemon does not answer. - store: share the SQLite table rebuild, row scanning, paged listing and retention purge logging. - kubernetes: share controller event handlers, workload IDs, replica defaults, conditions and the fields common to every controller kind. - api: factor id, JSON decoding and not-found handling in status page personalization handlers.
- app: break main, New, Start and the alert callback wiring into one step per subsystem, with pure builders for alert events. - alert: add ChannelPatch so the REST and MCP channel updates share the same field application and validation. - multihost: route each agent event kind to its own method and move the Push session loop into a dedicated type. - kubernetes: list every controller kind through one generic helper.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Codebase cleanup driven by static analysis (deadcode, dupl, gocyclo). No behaviour change intended.
Dead code
main; test-only hooks move into test files, and tests of thin wrappers now target the real function.SocketUnavailableError) into the connect paths, so an unreachable daemon tells the operator how to mount the socket or setDOCKER_HOST.Duplication
Complexity (every function now under the gocyclo threshold)
main,New,Startand the alert callback wiring split into one step per subsystem.ChannelPatchshared by the REST and MCP channel updates.Two SQLite rebuild log lines are reworded (e.g.
cert monitor SNI rebuild startingbecomescert sni rebuild starting).