Skip to content

refactor: code quality improvements#18

Merged
ibrahimkizilarslan merged 1 commit into
mainfrom
refactor/code-quality-improvements
Jun 8, 2026
Merged

refactor: code quality improvements#18
ibrahimkizilarslan merged 1 commit into
mainfrom
refactor/code-quality-improvements

Conversation

@ibrahimkizilarslan

Copy link
Copy Markdown
Owner
  1. Removed duplicate validation (M3): The validate CLI command previously called LoadConfig (which inherently runs validation) and then called cfg.Validate() again. Removed the redundant call.
  2. Unexported ActionHandlers map (M6): Made actionHandlers private to prevent global mutable state bugs. Added GetSupportedActions() and GetActionHandler() accessors to preserve testability.
  3. Updated tests: Migrated all unit tests in pkg/engine and tests/engine to use the new action handlers accessor methods.
  4. Constants for static data (M5): Changed allowPrivateNetworks from a global mutable variable to a constant to prevent accidental or malicious runtime modification.

1. Removed duplicate validation (M3): The validate CLI command
   previously called LoadConfig (which inherently runs validation)
   and then called cfg.Validate() again. Removed the redundant call.
2. Unexported ActionHandlers map (M6): Made actionHandlers private
   to prevent global mutable state bugs. Added GetSupportedActions()
   and GetActionHandler() accessors to preserve testability.
3. Updated tests: Migrated all unit tests in pkg/engine and
   tests/engine to use the new action handlers accessor methods.
4. Constants for static data (M5): Changed allowPrivateNetworks
   from a global mutable variable to a constant to prevent
   accidental or malicious runtime modification.
@ibrahimkizilarslan ibrahimkizilarslan merged commit 95fc2f3 into main Jun 8, 2026
2 checks passed
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