Subcategory: Code complexity
Score: 5 → 10
Average complexity is healthy — A (3.26) across 53 blocks, and all 10 modules rank A on the maintainability index. Two outliers drag the score down, both ranked E (radon's second-worst grade):
src/pycharting/api/interface.py:75 plot — E (33), 13 parameters, ~37 branch points across a ~240-line body
src/pycharting/data/ingestion.py:27 validate_input — E (31), 8 parameters
Both are wide optional-kwarg normalizers: a long sequential run of if arg is None / isinstance coercion branches. Suggested decomposition — extract per-concern helpers (array coercion, OHLC fallback derivation, overlay validation, subplot-spec validation, trade validation), or accept a params dataclass / Pydantic model instead of 13 positional-or-keyword arguments.
Also worth trimming while in the area (rank B, not currently failing):
src/pycharting/core/lifecycle.py:99 _monitor_connection — B (9)
src/pycharting/core/lifecycle.py:190 stop_server — B (9)
src/pycharting/data/ingestion.py:328 DataManager.get_chunk — B (10)
done when
uvx radon cc src -a -s shows no block ranked worse than C (CC ≤ 10), with the 100% coverage gate still green.
Evidence
src/pycharting/api/interface.py
F 75:0 plot - E (33)
src/pycharting/data/ingestion.py
F 27:0 validate_input - E (31)
Average complexity: A (3.2641509433962264)
Surfaced by the Rhiza quality gates during the template bump to jebel-quant/rhiza@v1.2.2, which enabled the stricter ruff rule families (ANN, A, BLE, ARG) and TYPECHECKER=both. Gate status at time of filing: make fmt FAIL, make typecheck FAIL, make docs-coverage FAIL, test-layout FAIL; make deptry, make security, make test PASS (154 tests, 100% coverage).
Subcategory: Code complexity
Score: 5 → 10
Average complexity is healthy — A (3.26) across 53 blocks, and all 10 modules rank A on the maintainability index. Two outliers drag the score down, both ranked E (radon's second-worst grade):
src/pycharting/api/interface.py:75plot— E (33), 13 parameters, ~37 branch points across a ~240-line bodysrc/pycharting/data/ingestion.py:27validate_input— E (31), 8 parametersBoth are wide optional-kwarg normalizers: a long sequential run of
if arg is None/isinstancecoercion branches. Suggested decomposition — extract per-concern helpers (array coercion, OHLC fallback derivation, overlay validation, subplot-spec validation, trade validation), or accept a params dataclass / Pydantic model instead of 13 positional-or-keyword arguments.Also worth trimming while in the area (rank B, not currently failing):
src/pycharting/core/lifecycle.py:99_monitor_connection— B (9)src/pycharting/core/lifecycle.py:190stop_server— B (9)src/pycharting/data/ingestion.py:328DataManager.get_chunk— B (10)done when
uvx radon cc src -a -sshows no block ranked worse than C (CC ≤ 10), with the 100% coverage gate still green.Evidence
Surfaced by the Rhiza quality gates during the template bump to
jebel-quant/rhiza@v1.2.2, which enabled the stricter ruff rule families (ANN, A, BLE, ARG) andTYPECHECKER=both. Gate status at time of filing:make fmtFAIL,make typecheckFAIL,make docs-coverageFAIL, test-layout FAIL;make deptry,make security,make testPASS (154 tests, 100% coverage).