MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / getResolutionEdgesFromFiles

Method getResolutionEdgesFromFiles

src/db/queries.ts:5548–5564  ·  view source on GitHub ↗

* Resolution edges leaving any node of `files` — the candidates when an * importer's bindings may have moved (a Python package's `__init__.py` * edited). The caller narrows them by the names each file binds.

(
    language: Language,
    files: string[]
  )

Source from the content-addressed store, hash-verified

5546 * edited). The caller narrows them by the names each file binds.
5547 */
5548 getResolutionEdgesFromFiles(
5549 language: Language,
5550 files: string[]
5551 ): Array<Edge & { edgeId: number; sourceFilePath: string; sourceLanguage: Language }> {
5552 const ids: number[] = [];
5553 for (let i = 0; i < files.length; i += SQLITE_PARAM_CHUNK_SIZE) {
5554 const chunk = files.slice(i, i + SQLITE_PARAM_CHUNK_SIZE);
5555 const rows = this.db
5556 .prepare(
5557 `SELECT e.id AS id FROM nodes n CROSS JOIN edges e ON e.source = n.id
5558 WHERE n.file_path IN (${chunk.map(() => '?').join(',')})`
5559 )
5560 .all(...chunk) as Array<{ id: number }>;
5561 for (const r of rows) ids.push(r.id);
5562 }
5563 return this.loadResolutionEdges(language, ids);
5564 }
5565
5566 /**
5567 * Full rows for resolution edges by id, loaded edge-first (CROSS JOIN pins

Callers 1

Calls 6

loadResolutionEdgesMethod · 0.95
mapMethod · 0.80
pushMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected