Problem
Radon rates exactly four functions at cyclomatic-complexity grade D — everything else in the package is C or better, so the complexity is concentrated and tractable:
| Function |
Location |
CC |
_compute_fixed_point_ig |
_compute_fp.py:159 |
25 |
DiscreteDP.__init__ |
markov/ddp.py:299 |
24 |
brent_max |
optimize/scalar_maximization.py:5 |
24 |
polym_lcp_solver |
game_theory/howson_lcp.py:36 |
23 |
DiscreteDP.__init__ alone dispatches dense/sparse × full/state-action-pairs input forms inline; _compute_fixed_point_ig interleaves algorithm and bookkeeping. High-CC plus hand-verified numerics is where regressions hide.
Proposed change
One PR per function; behavior-preserving extraction only:
DiscreteDP.__init__ → extract _parse_full_form(...) / _parse_sa_form(...) validators returning a normalized bundle.
_compute_fixed_point_ig → separate the iteration loop from error/logging bookkeeping.
brent_max is Numba-jitted — some branching is inherent to Brent; treat as best-effort.
- Guard with before/after output equality on existing tests (coverage in these regions is strong).
Related context: #480 (repeated logic in several modules).
Acceptance criteria
From the July 2026 technical-debt audit (AI-assisted; claims verified against 28d4b3b on 2026-07-25).
Problem
Radon rates exactly four functions at cyclomatic-complexity grade D — everything else in the package is C or better, so the complexity is concentrated and tractable:
_compute_fixed_point_ig_compute_fp.py:159DiscreteDP.__init__markov/ddp.py:299brent_maxoptimize/scalar_maximization.py:5polym_lcp_solvergame_theory/howson_lcp.py:36DiscreteDP.__init__alone dispatches dense/sparse × full/state-action-pairs input forms inline;_compute_fixed_point_iginterleaves algorithm and bookkeeping. High-CC plus hand-verified numerics is where regressions hide.Proposed change
One PR per function; behavior-preserving extraction only:
DiscreteDP.__init__→ extract_parse_full_form(...)/_parse_sa_form(...)validators returning a normalized bundle._compute_fixed_point_ig→ separate the iteration loop from error/logging bookkeeping.brent_maxis Numba-jitted — some branching is inherent to Brent; treat as best-effort.Related context: #480 (repeated logic in several modules).
Acceptance criteria
From the July 2026 technical-debt audit (AI-assisted; claims verified against
28d4b3bon 2026-07-25).