Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

code-reading-load

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.

Use

Requires Bun and pnpm.

pnpm install
pnpm analyze -- src
pnpm analyze -- --limit 10 src/index.ts src/routes
pnpm analyze -- --json src > analysis.json

To expose the binary from a local clone:

pnpm link --global
code-reading-load src

The command accepts .ts, .tsx, .mts, and .cts files. Directory traversal ignores node_modules and declaration files.

What it measures

  • 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; --limit only affects text output.

Development

pnpm typecheck
pnpm test

Known limits

  • 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.

About

OXC and tsgo analyzer for TypeScript code-reading load

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages