Learn

How to visualize code dependencies.

Every codebase has a dependency structure. Most teams can't see it. The approaches range from manual diagrams that go stale in days to automated graphs that update with every scan. Here's what each approach gives you and where it falls short.

Four approaches to dependency visualization.

Each method trades off effort, accuracy, and scope differently.

01

Manual Diagrams

Common but fragile

Most teams start here: someone draws a diagram in Lucidchart, Miro, or a whiteboard. It's useful for the meeting where it's created. Within weeks, it's stale. Within months, it's actively misleading. Manual diagrams can't keep up with the rate of code changes.

Limitation: Goes stale immediately. No connection to actual code.

02

IDE Plugins

Useful but narrow

VS Code, IntelliJ, and other IDEs offer dependency visualization plugins that show import chains for the file you're currently viewing. They're helpful for local navigation but can't show the full system. You see the tree from one leaf, not the forest.

Limitation: Limited to the scope of a single file or module.

03

Build Tool Graphs

Partial coverage

Tools like webpack, Rollup, and Maven can output dependency graphs based on build resolution. These are accurate for what the build system sees, but they miss runtime dependencies, database references, configuration imports, and anything resolved dynamically.

Limitation: Only captures what the build system resolves.

04

Dedicated Analysis Platforms

Comprehensive

Purpose-built platforms that parse the entire codebase using AST analysis, build a complete dependency graph, and render it with structural metadata — centrality scores, SPOF flags, cluster boundaries, and risk indicators. The graph is generated from the code itself and updates with every scan.

Limitation: Requires running an analysis tool. The tradeoff is accuracy.

What a good dependency visualization shows.

A dependency graph is only useful if it shows structure, not just connections.

Edges with Confidence Levels

Not all dependencies are equal. A hard import (explicit import statement) is different from a soft dependency (inferred from naming conventions or dynamic resolution). Good visualization distinguishes between them so you know which connections are certain and which are probabilistic.

Transitive Closures

Showing only direct imports misses the most important relationships. If File A imports File B imports File C, changing File C affects File A — but a simple import graph won't make that obvious. Transitive closure shows the full chain of impact.

Clusters and Zones

A flat graph of 500 nodes is unusable. Good dependency visualization automatically clusters files into zones — groups of tightly-coupled files that form logical subsystems. This turns an unreadable hairball into a navigable architecture map.

Centrality Highlighting

Some files are more structurally important than others. Centrality metrics (PageRank, betweenness, in-degree) identify which files are the hubs of the system. Visualizing centrality as node size or color makes structural risk immediately visible.

SPOF Markers

Files that are single points of failure — where a change or failure cascades across the system — should be visually distinct. A good dependency visualization flags SPOFs explicitly, with their blast radius and affected zone count, so critical files can't be overlooked.

Automated dependency graphs with Axiom Refract.

Axiom Refract parses your entire codebase using Tree-sitter AST analysis across 145+ languages. It extracts every import, function call, and cross-file reference to build a complete dependency graph — not from build output, but from the actual source code.

The resulting graph includes hard and soft edges with confidence levels, automatic zone clustering using community detection algorithms, centrality scoring (PageRank, betweenness, composite) for every node, and SPOF flags for files that exceed risk thresholds.

The graph is queryable via API and MCP, exportable in multiple formats, and rendered in an interactive viewer that lets you explore zones, trace dependency chains, and see blast radius for any file — all generated automatically from the code itself.

See your codebase's real dependency structure.

Upload your repository. Get a complete dependency graph with centrality scoring, zone clustering, SPOF markers, and blast radius for every file.