MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / GraphBuilder

Class GraphBuilder

src/codegraphcontext/tools/graph_builder.py:34–1214  ·  view source on GitHub ↗

Build and manage the code graph. Provides a high-level facade over the indexing pipeline, including repository ingestion, file parsing, call resolution, and inheritance linking for Neo4j, FalkorDB, and Kùzu backends.

Source from the content-addressed store, hash-verified

32
33
34class GraphBuilder:
35 """Build and manage the code graph.
36
37 Provides a high-level facade over the indexing pipeline, including
38 repository ingestion, file parsing, call resolution, and inheritance
39 linking for Neo4j, FalkorDB, and Kùzu backends.
40 """
41
42 def __init__(self, db_manager: DatabaseManager, job_manager: JobManager, loop: asyncio.AbstractEventLoop):
43 """Initialize GraphBuilder.
44
45 Parameters
46 ----------
47 db_manager : DatabaseManager
48 Active database manager instance.
49 job_manager : JobManager
50 Job manager for tracking indexing progress.
51 loop : asyncio.AbstractEventLoop
52 Event loop for async operations.
53 """
54 self.db_manager = db_manager
55 self.job_manager = job_manager
56 self.loop = loop
57 self.driver = self.db_manager.get_driver()
58 self._writer = GraphWriter(self.driver, db_manager=self.db_manager)
59 self.last_call_resolution_diagnostics: list[Dict[str, Any]] = []
60 self.last_index_summary: Dict[str, Any] = {}
61 self.parsers = {
62 ".py": "python",
63 ".ipynb": "python",
64 ".js": "javascript",
65 ".jsx": "javascript",
66 ".mjs": "javascript",
67 ".cjs": "javascript",
68 ".go": "go",
69 ".ts": "typescript",
70 ".mts": "typescript",
71 ".cts": "typescript",
72 ".d.ts": "typescript",
73 ".tsx": "tsx",
74 ".cpp": "cpp",
75 ".h": "cpp",
76 ".hpp": "cpp",
77 ".hh": "cpp",
78 ".rs": "rust",
79 ".c": "c",
80 ".java": "java",
81 ".rb": "ruby",
82 ".cs": "c_sharp",
83 ".php": "php",
84 ".kt": "kotlin",
85 ".scala": "scala",
86 ".sc": "scala",
87 ".swift": "swift",
88 ".hs": "haskell",
89 ".dart": "dart",
90 ".pl": "perl",
91 ".pm": "perl",

Callers 4

index_fixtureFunction · 0.90
__init__Method · 0.85
switch_context_toolMethod · 0.85
_initialize_servicesFunction · 0.85

Calls

no outgoing calls

Tested by 1

index_fixtureFunction · 0.72