refactor: reduce cognitive complexity across codebase#207
Open
Galois123 wants to merge 9 commits intolanggenius:mainfrom
Open
refactor: reduce cognitive complexity across codebase#207Galois123 wants to merge 9 commits intolanggenius:mainfrom
Galois123 wants to merge 9 commits intolanggenius:mainfrom
Conversation
added 9 commits
January 12, 2026 11:33
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.
Summary
Refactor multiple components to reduce cognitive complexity and improve code maintainability by extracting functions, eliminating magic strings, and simplifying control flows.
Changes
This PR contains 9 focused refactor commits:
Constant Extraction
Function Decomposition
releaseLibBinaryinto focused helper functionsreleaseLibBinaryandInstallDependenciesflowsWithTempDirhelper methodsInitConfiginto focused configuration loadersFiles Changed
internal/controller/run.go(+6, -4)internal/core/runner/nodejs/setup.go(+59, -39)internal/core/runner/output_capture.go(+105, -85)internal/core/runner/python/setup.go(+116, -77)internal/core/runner/temp_dir.go(+40, -33)internal/static/config.go(+103, -80)internal/utils/log/core.go(+5, -3)Benefits
Testing
All existing tests pass. No functional changes - purely structural improvements.