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

Method getPythonFilesWithEdgesInto

src/db/queries.ts:6121–6134  ·  view source on GitHub ↗

* The python files with an edge of one of `kinds` into a node of `filePath` * whose kind is one of `targetKinds` — who subclasses, calls or constructs * what a file defines.

(filePath: string, kinds: string[], targetKinds: string[])

Source from the content-addressed store, hash-verified

6119 * what a file defines.
6120 */
6121 getPythonFilesWithEdgesInto(filePath: string, kinds: string[], targetKinds: string[]): string[] {
6122 const kp = kinds.map(() => '?').join(',');
6123 const tp = targetKinds.map(() => '?').join(',');
6124 return (this.db
6125 .prepare(
6126 `SELECT DISTINCT src.file_path AS file_path
6127 FROM edges e
6128 JOIN nodes tgt ON tgt.id = e.target
6129 JOIN nodes src ON src.id = e.source
6130 WHERE tgt.file_path = ? AND e.kind IN (${kp}) AND tgt.kind IN (${tp})
6131 AND src.language = 'python' AND src.file_path != ?`
6132 )
6133 .all(filePath, ...kinds, ...targetKinds, filePath) as Array<{ file_path: string }>).map((r) => r.file_path);
6134 }
6135
6136 replaceResolutionEdgesWithUnresolvedRefs(
6137 edgeIds: number[],

Callers 1

Calls 4

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

Tested by

no test coverage detected