Skip to content

Exclude frontend files from Sonar analysis and introduce constants#143

Merged
akiidjk merged 11 commits intodevfrom
hotfix/akiidjk_fixies
Mar 4, 2026
Merged

Exclude frontend files from Sonar analysis and introduce constants#143
akiidjk merged 11 commits intodevfrom
hotfix/akiidjk_fixies

Conversation

@akiidjk
Copy link
Collaborator

@akiidjk akiidjk commented Mar 4, 2026

This pull request introduces several improvements and refactorings across the codebase, focusing on increased maintainability, consistency, and code reuse. The main changes include the introduction of constants to avoid magic strings and repeated literals, improved configuration file handling, and enhanced clarity in command descriptions and logging.

Refactoring for Consistency and Maintainability:

  • Introduced constants in api.go (such as invaldUrlMessage, cookieName, and sucessMessage) to replace repeated string literals, improving maintainability and reducing the risk of typos. Updated all relevant usages to reference these constants. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

  • Defined a defaultConfigName constant in manager.go and used it throughout the configuration management code, replacing hardcoded "config.yml" strings for improved consistency. [1] [2] [3] [4] [5] [6]

TUI Command Handling Improvements:

  • Added constants for exploit-related commands (exploitListCommand, exploitStopCommand, exploitRunCommand) in the TUI layer, replacing magic strings and updating all usages for better code clarity and easier refactoring. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]

Documentation and Usability Enhancements:

  • Improved flag descriptions in the exploit command CLI to clarify their usage in different modes (test, direct submit, submit mode). [1] [2]

Other Minor Improvements:

  • Added a named constant for the main layout path in the server view handler for better maintainability.
  • Updated the base image version in the Dockerfile for the runtime stage to a specific Alpine version for more predictable builds.

These changes collectively make the codebase more robust, readable, and easier to maintain.

akiidjk added 11 commits March 4, 2026 15:32
Replace local variable 'round' with 'nround' to avoid shadowing the
built-in round() function. Also adjusted import ordering and cleaned up
whitespace.
Consolidate and rename error/log message constants in client/server
APIs,
and use formatted error strings for request creation/sending.
Make TUI validation and render errors more descriptive.
Add helpers in Python CLI to normalize architectures, map platforms,
and enumerate available binaries; improve binary-not-found diagnostics.
Centralize flagchecker host warning text and tidy imports in exploiter
manager.
Use bin_dir.rglob to find files and filter to relative paths with
exactly four components (preserving the bin/arch/platform/file layout).
Replace nested directory iterations and remove an unnecessary NOSONAR
comment.
Use camelCase per Go naming conventions; update function parameters and
X-Team-Token header usage in PROTOCOL_GUIDE.md and cc_http.go
@akiidjk
Copy link
Collaborator Author

akiidjk commented Mar 4, 2026

Ok fixed all issue last things is the Coverage not good but because not all modules are tested.

@akiidjk akiidjk merged commit 9bce7ae into dev Mar 4, 2026
1 of 2 checks passed
@akiidjk akiidjk deleted the hotfix/akiidjk_fixies branch March 6, 2026 14:42
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