# How the graph works

**The graph is a map of your code made of things and links.** The things are parts of your code, such as methods, classes, files, routes, tables and events. The links say how they relate: this method calls that one, this class extends that one, this method writes to that table.

**An everyday comparison:** a family tree, but for code. You can start from any person and walk to their parents, their children, or their cousins.

## What is in it

| Things (nodes) | Links (edges) |
| --- | --- |
| Methods and constructors, classes, interfaces, enums, files (modules), outside libraries, outbound HTTP calls, data stores (tables, collections, queues), events | Calls; has-method; imports; uses-type; returns; extends; implements; overrides; reads-from, writes-to, deletes-from (data); calls-HTTP; handled-by (a route to the method that serves it); triggers-event and event-handled-by |

**What is not in it: your source code.** The graph keeps names, places (file and line) and links. When a tool shows you code, it reads the file from disk at that moment.

## How it is built

- Niro reads each source file and works out its structure. This step is called parsing.

- It then matches every name used to the thing it names, across the whole project. This step is called resolving. For example, it finds which `send` method a call to `send()` reaches.

- It recognises routes, outbound calls, data access and events from tables of known libraries and frameworks.

Building and keeping it current: [Builds and updates](https://help.niroai.dev/cli/builds-and-updates/).

## How to read an answer

- **"confidence: partial"** means Niro listed everything it could place, and found some calls it could not. It says how many, and where to look. A common cause is a call made on a value whose type the code does not state.

- **"has_more: true"** means the answer was cut to a page. Ask again with `offset` or a narrower question.

- **`[possible]`** marks a caller that might reach the method, but not certainly.

- **"inferred, target unconfirmed"** marks an HTTP link where Niro could not work out the address being called. It is listed separately, and not counted in the risk.

- **A stand-in** is a placeholder for code the graph could not place, for example a method of an outside library. A call that lands on a stand-in is real, but Niro did not find its target in your project.

- **"No code in the project calls it: it is called by its framework"** means a framework calls the method for you, for example a web route handler.

## What it cannot see

- **Routes and calls built while the program runs**, from values computed at that time.

- **Files over 2 MB, and files that take more than 20 seconds to read.** Both limits can be raised.

- **Languages it has no reader for.** See [Supported languages](https://help.niroai.dev/cli/supported-overview/).

The known gaps, by kind, are in [FAQ: wrong or missing answers](https://help.niroai.dev/cli/faq-wrong-or-missing-answers/).