Skip to content

Measure module depth as implementation size per exported symbol #18

Closed

Description

@typeweaver

Context

The history-based signals approximate module depth. Ousterhout's depth itself — how much implementation sits behind how much interface — needs the code: the size of a module's public surface against the size of its implementation.

Goal

For TypeScript/JavaScript modules, codeheat reports a depth ratio (implementation lines per exported symbol) so shallow modules with wide interfaces and little behind them stand out.

Acceptance criteria

  • Exported symbols of a module's entry points are counted with the TypeScript compiler API (re-exports followed); implementation lines come from the existing metrics.
  • The Report gains an additive per-module depth field, null for unsupported languages; documented in the schema and GLOSSARY.md.
  • Tests cover a deep module (few exports, large implementation) and a shallow one.
  • Bundle size and analysis time on a ~4,000-commit TypeScript monorepo are measured before and after and recorded in the pull request.

References

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions