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

Method getFilesWithEdgesInto

src/db/queries.ts:3986–4004  ·  view source on GitHub ↗

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

(targetIds: string[])

Source from the content-addressed store, hash-verified

3984
3985 /** The files with a resolution edge into one of `targetIds`. */
3986 getFilesWithEdgesInto(targetIds: string[]): string[] {
3987 const files = new Set<string>();
3988 for (let i = 0; i < targetIds.length; i += SQLITE_PARAM_CHUNK_SIZE) {
3989 const chunk = targetIds.slice(i, i + SQLITE_PARAM_CHUNK_SIZE);
3990 const placeholders = chunk.map(() => '?').join(',');
3991 const rows = this.db
3992 .prepare(
3993 `SELECT DISTINCT src.file_path AS file_path
3994 FROM edges e
3995 JOIN nodes src ON src.id = e.source
3996 WHERE e.target IN (${placeholders})
3997 AND e.kind != 'contains'
3998 AND (e.provenance IS NULL OR e.provenance != 'heuristic')`
3999 )
4000 .all(...chunk) as Array<{ file_path: string }>;
4001 for (const row of rows) files.add(row.file_path);
4002 }
4003 return [...files];
4004 }
4005
4006 /** The import nodes named one of `names` (an import node is named by the module path it imports). */
4007 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