Skip to content

fix: resolve all SonarQube issues and add coverage tests#78

Merged
Otoru merged 4 commits into
mainfrom
sonarqube-fixes
May 20, 2026
Merged

fix: resolve all SonarQube issues and add coverage tests#78
Otoru merged 4 commits into
mainfrom
sonarqube-fixes

Conversation

@Otoru

@Otoru Otoru commented May 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix BLOCKER in observability/logger.py — correlation filter always returned True regardless of span validity
  • Replace Union[X, None] with X | None across all CLI modules (SonarQube prefer modern union syntax)
  • Reduce cognitive complexity in channel.py, protocol/base.py, protocol/reader_fsm.py, protocol/telemetry.py, group/ring.py, and observability/server.py by extracting focused helper methods
  • Add sonar-project.properties for reproducible scanner configuration
  • Add unit tests for: telemetry log helpers, reader FSM event-lock multi-part paths, and protocol base I/O EOF/error paths

Quality gate result

Metric Before After Threshold
new_violations 40 0 0
new_coverage 94.2% ≥ 80%
new_duplicated_lines_density 0.87% ≤ 3%

All conditions: OK

Test plan

  • poetry run pytest — 242 passed
  • poetry run black --check genesis/ tests/ examples/
  • poetry run mypy

Otoru added 4 commits May 19, 2026 23:25
- Fix BLOCKER in observability/logger.py (filter logic always returned True)
- Replace Union[X, None] with X | None across CLI modules
- Reduce cognitive complexity in channel.py, protocol/base.py,
  protocol/reader_fsm.py, protocol/telemetry.py, group/ring.py,
  and observability/server.py by extracting helper methods
- Add sonar-project.properties for scanner configuration
- Add unit tests for telemetry helpers, reader FSM event-lock paths,
  and protocol base I/O error paths, raising new_coverage from 75.5% to 94.2%
@Otoru Otoru merged commit 547f97a into main May 20, 2026
11 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