Subcategory: Code complexity
Score: 5 → 8 (target)
Two functions rank E on cyclomatic complexity (radon cc), far past the C threshold (CC ≥ 11):
src/pycharting/api/interface.py:35 — plot — CC 32
src/pycharting/data/ingestion.py:29 — validate_input — CC 31
plot mixes list→array conversion, server acquire/reuse, URL construction, browser launch, a blocking loop, and error handling in one body. validate_input bundles index handling, per-series conversion, OHLC-mode selection, and high/low validation.
Suggested fix: extract helpers — e.g. _coerce_inputs, _acquire_server, _build_chart_url, _run_blocking for plot; split OHLC-mode selection and high/low bounds checks out of validate_input.
Done when: no block in src/ exceeds CC 10 — uvx radon cc src -s reports no C-or-worse block.
Subcategory: Code complexity
Score: 5 → 8 (target)
Two functions rank E on cyclomatic complexity (
radon cc), far past the C threshold (CC ≥ 11):src/pycharting/api/interface.py:35—plot— CC 32src/pycharting/data/ingestion.py:29—validate_input— CC 31plotmixes list→array conversion, server acquire/reuse, URL construction, browser launch, a blocking loop, and error handling in one body.validate_inputbundles index handling, per-series conversion, OHLC-mode selection, and high/low validation.Suggested fix: extract helpers — e.g.
_coerce_inputs,_acquire_server,_build_chart_url,_run_blockingforplot; split OHLC-mode selection and high/low bounds checks out ofvalidate_input.Done when: no block in
src/exceeds CC 10 —uvx radon cc src -sreports no C-or-worse block.