All insights

Code understanding

Why large codebases are hard to understand

The difficulty is often in relationships, boundaries and historical decisions rather than the number of files.

The difficult part is between the files

A repository can have a tidy directory tree and still be difficult to understand. The behavior you care about may begin in a request handler, pass through a shared contract and finish in a background job. Each file explains a part of the story. Understanding the system means connecting those parts.

From entry point to supporting code

The checkout entry point reaches a service, its payment and order dependencies, a validation contract and a test. Lines illustrate static relationships, not runtime execution.

Entry pointcheckout.test.ts
01
Checkout servicecheckout-service.ts
02
Payment gatewaypayment-gateway.ts
03
Order moduleorder-service.ts
04
Validation contractvalidation.ts
05
Related checkscheckout.test.ts
06
Selected module · Static relationships · Supporting checks
Illustrative relationships; the diagram explains a question rather than a live repository.

Size adds work, but uncertainty adds friction. When you cannot tell which module owns a decision, every change starts with another investigation. Comments and naming conventions help. They become much more useful when you can relate them to the calls, types and boundaries present in the source.

Choose a question before choosing a view

“Understand this repository” is an open-ended assignment. “Where is a checkout total calculated?” gives an investigation a useful boundary. It identifies a behavior, suggests an entry point and creates a way to decide whether the answer is complete enough for the next step.

Start with a recognizable route, command or public interface. Read what enters it and what leaves it. Follow one important relationship at a time. Keep a short record of what each module contributes rather than trying to memorize the repository.

  • Name the behavior you need to explain.

  • Find a source location that participates in it.

  • Follow the relationships that account for the behavior.

  • Record the parts you have not yet verified.

Separate location from responsibility

Consider an order workflow. A folder called payments may contain an adapter to an external provider, while the decision to charge an order belongs to a checkout service elsewhere. The folder name tells you where to look; the call sites and contracts explain who is responsible for what.

This distinction matters during onboarding and refactoring. Moving a file does not necessarily move its responsibility. A more useful map shows both the source structure and the relationships crossing its boundaries. Reading those boundaries can reveal coupling that a directory tree alone cannot explain.

Keep the map connected to evidence

A graph provides candidates for investigation. It does not prove every possible runtime behavior. Configuration, generated code and dynamically selected components can affect what happens in a running system. Missing relationships deserve a question, not an assumption that nothing is connected.

Check the source behind a relationship. Look for tests that describe the expected behavior and note the revision you inspected. If the code changes during the investigation, revisit the observations that influenced your conclusion. A useful explanation should distinguish what you saw from what you inferred.

Leave the next engineer a smaller problem

The result does not need to be an exhaustive architecture document. A short explanation of an entry point, its key dependencies and the checks that support your understanding is often easier to maintain. Include links to source locations and explain why those locations matter.

Graphtia Explorer is being developed around this movement between relationships and source context. The goal is to help engineers find a meaningful starting point and keep investigating without losing their place. The graph supports the work; the explanation remains grounded in the code.

Keep exploring

Graphtia

This page is on its way. Join the waitlist to hear what’s next for Graphtia.

Join waitlist