Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / module
graph
codeintel.graph
PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.
PHAROS at 975a38dMIT license
Around this symbol
Search all symbolsLoading
| Symbol | File | Resolved by |
|---|---|---|
| _python_module_index | graph.py | same file |
| _resolve_path_import | graph.py | same file |
| _resolve_python_import | graph.py | same file |
| build_edges | graph.py | same file |
| ChunkNode | graph.py | same file |
| Edge | graph.py | same file |
| GraphStats | graph.py | same file |
| Symbol | File | Resolved by |
|---|---|---|
| indexer | indexer.py | through an import |
codeintel.graphbackend/app/codeintel/graph.py, lines 1–40Open source
"""Structural graph between the chunks of one repository.Edges are derived purely from parse output (no code execution):``contains`` class/impl → method, module → top-level symbol (same file)``imports`` module chunk → module chunk of an imported file in the repo``calls`` symbol → symbol it calls, resolved in this order: 1. ``same_file`` exactly one symbol with that name in the caller's file 2. ``imported_file`` Python: the name is bound by an import in the file; other languages: exactly one definition in a file the caller's file imports 3. ``unique_name`` exactly one definition with that name in the repoAnything else (stdlib calls, overloaded names, dynamic dispatch) is counted asunresolved and **not** linked: a wrong edge feeds an assistant misleadingcontext, a missing edge only loses recall."""from __future__ import annotationsimport posixpathfrom collections import defaultdictfrom dataclasses import dataclass, field# Calls to these names are almost never interesting edges even when they# happen to resolve (constructors / dunder plumbing)._IGNORED_CALLS = frozenset({"__init__", "super", "self", "this", "new", "main", "init"})_JS_EXTS = (".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts")_TS_FOR_JS = {".js": (".ts", ".tsx"), ".jsx": (".tsx",), ".mjs": (".mts",), ".cjs": (".cts",)}@dataclassclass ChunkNode: id: str path: str language: str kind: str name: strShows the first 40 of 244 lines. The rest is on GitHub at this commit.
What the index recorded
- Signature
module backend.app.codeintel.graph- File
backend/app/codeintel/graph.py- Lines
- 1–244
- Parser
- python-ast
- Git blob
3791a0283d18722675047af567570cb2c1911c63- Call sites
- 1 named, 0 resolved, 1 left unlinked
- Outside this subset
- 1 more edges reach code outside the graph shown here
