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

Method getFilesWithEdgesInto

src/db/queries.ts:4097–4115  ·  view source on GitHub ↗

The files with a resolution edge into one of `targetIds`.

(targetIds: string[])

Source from the content-addressed store, hash-verified

4095
4096 /** The files with a resolution edge into one of `targetIds`. */
4097 getFilesWithEdgesInto(targetIds: string[]): string[] {
4098 const files = new Set<string>();
4099 for (let i = 0; i < targetIds.length; i += SQLITE_PARAM_CHUNK_SIZE) {
4100 const chunk = targetIds.slice(i, i + SQLITE_PARAM_CHUNK_SIZE);
4101 const placeholders = chunk.map(() => '?').join(',');
4102 const rows = this.db
4103 .prepare(
4104 `SELECT DISTINCT src.file_path AS file_path
4105 FROM edges e
4106 JOIN nodes src ON src.id = e.source
4107 WHERE e.target IN (${placeholders})
4108 AND e.kind != 'contains'
4109 AND (e.provenance IS NULL OR e.provenance != 'heuristic')`
4110 )
4111 .all(...chunk) as Array<{ file_path: string }>;
4112 for (const row of rows) files.add(row.file_path);
4113 }
4114 return [...files];
4115 }
4116
4117 /** The import nodes named one of `names` (an import node is named by the module path it imports). */
4118 getImportNodesByNames(names: string[]): Array<{ filePath: string; name: string; language: Language }> {

Callers 1

addPythonImportersFunction · 0.80

Calls 5

mapMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65
joinMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected