Skip to content

fix: Enhances code quality and robustness across components#296

Merged
hellobertrand merged 4 commits into
mainfrom
fix/sonarqube-findings-5
Jun 23, 2026
Merged

fix: Enhances code quality and robustness across components#296
hellobertrand merged 4 commits into
mainfrom
fix/sonarqube-findings-5

Conversation

@hellobertrand

@hellobertrand hellobertrand commented Jun 23, 2026

Copy link
Copy Markdown
Owner

This pull request addresses several SonarQube findings to improve overall code quality, type safety, and maintainability.

  • Improves Static Analysis: Extends clang-format coverage to include CLI source files and adds printf-style format checking attributes to logging functions in the CLI, enabling the compiler to catch format string mismatches at compile time.
  • Refines Type Safety: Introduces explicit constructors in the Node.js wrapper to prevent unintended implicit conversions and refines pointer type handling and const qualifiers in the CLI, especially during dictionary training, for better correctness.
  • Enhances Robustness and Readability: Extracts common state validation logic into a dedicated helper method within the Python wrapper's Seekable class, reducing code duplication. Also adds checks for zero-sized files and memory allocation failures during dictionary training in the CLI.

Relates to SonarQube findings

Addresses SonarQube findings related to constructors callable with a single argument that could be implicitly invoked.
Introduces compiler-assisted format string validation for logging functions and extends clang-format rules to the CLI source. Also refactors long lines and adds resource cleanup during dictionary loading, addressing static analysis findings.
Addresses static analysis findings related to explicit function pointer usage and
type consistency for sample data buffers.
Consolidates duplicate checks for a closed Seekable object into a private helper method, improving code maintainability and addressing static analysis findings.
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@hellobertrand hellobertrand merged commit b4a5304 into main Jun 23, 2026
84 checks passed
@hellobertrand hellobertrand deleted the fix/sonarqube-findings-5 branch June 23, 2026 05:02
@sonarqubecloud

Copy link
Copy Markdown

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