Skip to main content

Discover Natural Code Groupings with vg areas

vg areas reveals the natural communities in your codebase — clusters of tightly related modules that map to features and subsystems. Combine with vg map and vg oddities for a full architectural picture.

Difficulty
Intermediate
Duration
15 minutes
Steps
5

Codebases have implicit structure: clusters of modules that work closely together. vg areas reveals these natural communities, giving you a feature-and-subsystem map derived directly from the call graph.

Prerequisites

  • A built code graph from vg build

Steps

1. Build the graph

vg build

2. List the areas

vg areas

vg areas groups nodes into communities — clusters that depend on each other more than on the rest of the code.

3. Compare with the overview

Put the areas in context with the map-level overview:

vg map

vg map gives the high-level picture; vg areas breaks it into the communities inside.

4. Inspect a representative node

Pick a central node in an area and explain it:

vg show

This helps you name and understand what each area actually does.

5. Spot boundary violations

Once you know your areas, find links that break them:

vg oddities

Cross-area links that look wrong are candidate architectural smells.

Verification

Confirm vg areas returns distinct groupings of nodes. Sanity-check by opening a representative node with vg show and confirming its neighbors belong to the same feature.

Next Steps

  • Get the overview with vg map
  • Find cross-area smells with vg oddities
  • Find central modules with vg hubs

Prerequisites

  • A built code graph (vg build)

Steps

  • 1
    Build the graph
  • 2
    List the areas
  • 3
    Compare with the overview
  • 4
    Inspect a representative node
  • 5
    Spot boundary violations

Category

Vibgrate