Mapping codebase hotspots offline

In almost any older repository, trouble clusters in a small corner of the tree. Five percent of the files soak up half the bug-fix commits, import twenty other modules, and make everyone on the team hesitate before editing them.

I built Riftmap to see those high-churn corners on my own laptop without uploading private client repositories to an external SaaS dashboard.

Riftmap reports what it measured. It does not claim to predict bugs, and it does not dress up commit counts or line totals as “defect scores.” When a file cannot be parsed cleanly, it marks that gap instead of recording a fake zero.

Splitting the job between Zig and TypeScript

Walking tens of thousands of files and resolving import graphs on an Electron UI thread freezes the window almost immediately, so I split the work across three parts:

  1. Zig 0.13 scanner: walks the directory tree, counts bytes and lines, pulls out static import edges, estimates branching complexity, and records explicit coverage notes when it hits dynamic imports or unsupported syntax.
  2. Local git log reader: streams commit counts, author counts, and 30/90/180-day churn windows directly from the system git binary in read-only mode.
  3. Electron + React + Cytoscape.js viewer: plots churn against structural complexity in a scatter chart alongside an interactive import graph and a byte-sized directory treemap.

Writing the heavy file-walking pass in Zig while keeping the graph UI in TypeScript gave me fast scans on large repos without giving up interactive filtering, much like pairing Go or C++ backends (Wardline, SQLite Clone) with straightforward frontends elsewhere.


Linked mentions

You might also enjoy