Skip to content

Lift maintainability index of solver.py and inner.py (MI ≈50 → ≥65) #55

Description

@tschm

Subcategory: Code complexity — current 9 → target 10

Files:

  • src/nncg/solver.py (478 LOC, MI 49.89)
  • src/nncg/inner.py (388 LOC, MI 49.63)

Change: Extract cohesive helpers to reduce per-module size/density. These are the two largest and lowest-MI modules in the package; the others sit at 66–100. All cyclomatic-complexity blocks are already grade A (max CC 5, avg 2.38), so this is a density/maintainability improvement, not a control-flow one.

Evidence: uvx radon mi src -s

src/nncg/solver.py - A (49.89)
src/nncg/inner.py - A (49.63)
src/nncg/krylov.py - A (66.18)
src/nncg/api.py - A (100.00)

Done when: uvx radon mi src -s reports MI ≥ 65 for both solver.py and inner.py, with all CC blocks remaining grade A and test coverage staying at 100%.

Context: surfaced by the quality scorecard on the rhiza v1.1.3 boost — #54

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions