Back to the room

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 symbols

Loading

Contains (7)
SymbolFileResolved by
_python_module_indexgraph.pysame file
_resolve_path_importgraph.pysame file
_resolve_python_importgraph.pysame file
build_edgesgraph.pysame file
ChunkNodegraph.pysame file
Edgegraph.pysame file
GraphStatsgraph.pysame file
Imported by (1)
SymbolFileResolved by
indexerindexer.pythrough 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: str

Shows 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

Read it on GitHub at this commit