code-reading-load ranks TypeScript sections by the amount of code a reader must keep in mind. It combines OXC syntax facts with tsgo symbol resolution, so local metrics and cross-file reach refer to the same functions and modules.
The tool was extracted from an internal TypeScript architecture experiment. It contains no project-specific reports or fixtures.
Requires Bun and pnpm.
pnpm install
pnpm analyze -- src
pnpm analyze -- --limit 10 src/index.ts src/routes
pnpm analyze -- --json src > analysis.jsonTo expose the binary from a local clone:
pnpm link --global
code-reading-load srcThe command accepts .ts, .tsx, .mts, and .cts files. Directory traversal ignores node_modules and declaration files.
- Local load: cyclomatic complexity, control-flow depth, call sites, mutable state sites, callees, recursion, and dynamic calls.
- Reader load: visible interface items, directly and transitively reached sections, timing phases, and blast scope.
- The default working-set budget is four items. Rankings put sections with the most budget breaches first;
--limitonly affects text output.
pnpm typecheck
pnpm test- The semantic resolver uses a pinned unstable tsgo interface.
- The analysis follows imports only inside the current working directory.
- Metrics are heuristics for reading load, not proof that code is good or bad.
- Timing and blast-scope rules currently recognize Elysia lifecycle and composition methods; the local metrics are framework-independent.