Skip to content

cleanup opportunities complexity hotspots

Bryan edited this page Jun 13, 2026 · 1 revision

Complexity hotspots

The main cleanup opportunity is modularity in the largest source files. These files are core to Lode, so refactors should be small and test-backed.

Largest source files

File Lines Why it is hot
src/lode/indexer.py 691 File walking, parser dispatch, Python parsing, TS/JS parsing, Markdown parsing, config parsing, and node creation live together.
src/lode/graph.py 680 Import resolution, call resolution, inheritance resolution, traversal, filtering, and report shaping live together.
src/lode/storage.py 553 Schema creation, fact replacement, search, symbol lookup, neighbors, and embeddings persistence live together.
tests/test_graph.py 496 Good regression depth, but it may need grouping as graph features grow.

Refactor ideas

  • Split language parsers out of src/lode/indexer.py once another language is added.
  • Move impact report formatting out of src/lode/graph.py if traversal logic grows further.
  • Keep SQLite schema and query helpers in src/lode/storage.py, but consider isolating embedding persistence if vector behavior expands.

Guardrails

Run tests/test_graph.py after any resolver refactor and the full validator list from AGENTS.md before merging. The complexity gate in .github/workflows/ci.yml should remain green.

Related pages

Clone this wiki locally