Subcategory: Code complexity (9→10) and Overall architecture (9→10)
src/jquantstats/data.py is the largest module in the codebase at 808 LOC and trends toward a god-module. It also contains the worst-ranking complexity blocks in src/.
What to change
- Split
src/jquantstats/data.py (currently 808 LOC) so the module drops below ~500 LOC.
- Decompose the B(10) blocks:
Data.from_prices (L414), _apply_null_strategy (L36); also review Data._truncate_integer (L753, B/8) and interpolate (L89, B/7).
- Move construction/interpolation helpers out of
data.py into _utils/ to reduce coupling.
Evidence
radon cc src -s: Data.from_prices - B (10), _apply_null_strategy - B (10)
wc -l: src/jquantstats/data.py = 808 (largest module in src/)
Average CC across src/ is A (2.86) and there are zero C-or-worse blocks — this is the sole complexity/architecture edge.
Done when
src/jquantstats/data.py is < 500 LOC, and
- no block in
data.py exceeds CC B(7), and
make test / make typecheck / make docs-coverage remain green at 100%.
Context: PR #870
Subcategory: Code complexity (9→10) and Overall architecture (9→10)
src/jquantstats/data.pyis the largest module in the codebase at 808 LOC and trends toward a god-module. It also contains the worst-ranking complexity blocks insrc/.What to change
src/jquantstats/data.py(currently 808 LOC) so the module drops below ~500 LOC.Data.from_prices(L414),_apply_null_strategy(L36); also reviewData._truncate_integer(L753, B/8) andinterpolate(L89, B/7).data.pyinto_utils/to reduce coupling.Evidence
Average CC across
src/is A (2.86) and there are zero C-or-worse blocks — this is the sole complexity/architecture edge.Done when
src/jquantstats/data.pyis < 500 LOC, anddata.pyexceeds CC B(7), andmake test/make typecheck/make docs-coverageremain green at 100%.Context: PR #870