feat: implement issue #34 — SonarCloud: cognitive complexity (S3776) - #38
feat: implement issue #34 — SonarCloud: cognitive complexity (S3776)#38don-petry wants to merge 1 commit into
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Dev-Lead — review-changes (no-changes)No changes were needed for this PR. |
There was a problem hiding this comment.
Pull request overview
Refactors the three CLI extraction scripts flagged by SonarCloud rule python:S3776 by extracting pure helper functions, and adds offline unit tests to lock in helper behavior in CI (without requiring a BroodMinder API key).
Changes:
scripts/discover.py: extract sample-id discovery and “probe one endpoint” logic into helpers to keepmain()flatter.scripts/extract_all.py: split parsing, hive selection, window processing, and budget/early-exit logic into helpers; replaceStopIteration-based unwinding with a dedicated exception.scripts/flatten.py: split the two-pass flattening pipeline into helpers (metric-key discovery, deduped streaming, notes flattening, coverage summarization) and add unit tests for the pure parts; adjust pytest skipping so only the live contract test module is skipped without an API key.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_refactor.py | Adds offline unit tests covering newly extracted pure helpers used by the refactored scripts. |
| tests/conftest.py | Changes CI behavior to skip only the live contract test module when BROODMINDER_API_KEY is missing. |
| scripts/flatten.py | Extracts helper functions for metric discovery, row building, deduped streaming, note writing, and coverage output. |
| scripts/extract_all.py | Refactors main() into helper functions for argument parsing, hive selection, per-hive processing, and early-exit/budget handling. |
| scripts/discover.py | Extracts helper functions to find sample IDs and to probe endpoints with shared error handling/printing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import sys | ||
| from datetime import datetime, timezone | ||
| from pathlib import Path |


Closes #34
Implemented by dev-lead agent. Please review.