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

Method getPythonFilesWithEdgesInto

src/db/queries.ts:5793–5806  ·  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

5791 * what a file defines.
5792 */
5793 getPythonFilesWithEdgesInto(filePath: string, kinds: string[], targetKinds: string[]): string[] {
5794 const kp = kinds.map(() => '?').join(',');
5795 const tp = targetKinds.map(() => '?').join(',');
5796 return (this.db
5797 .prepare(
5798 `SELECT DISTINCT src.file_path AS file_path
5799 FROM edges e
5800 JOIN nodes tgt ON tgt.id = e.target
5801 JOIN nodes src ON src.id = e.source
5802 WHERE tgt.file_path = ? AND e.kind IN (${kp}) AND tgt.kind IN (${tp})
5803 AND src.language = 'python' AND src.file_path != ?`
5804 )
5805 .all(filePath, ...kinds, ...targetKinds, filePath) as Array<{ file_path: string }>).map((r) => r.file_path);
5806 }
5807
5808 replaceResolutionEdgesWithUnresolvedRefs(
5809 edgeIds: number[],

Callers 1

Calls 4

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

Tested by

no test coverage detected