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

Method getPythonFilesWithEdgesInto

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

5680 * what a file defines.
5681 */
5682 getPythonFilesWithEdgesInto(filePath: string, kinds: string[], targetKinds: string[]): string[] {
5683 const kp = kinds.map(() => '?').join(',');
5684 const tp = targetKinds.map(() => '?').join(',');
5685 return (this.db
5686 .prepare(
5687 `SELECT DISTINCT src.file_path AS file_path
5688 FROM edges e
5689 JOIN nodes tgt ON tgt.id = e.target
5690 JOIN nodes src ON src.id = e.source
5691 WHERE tgt.file_path = ? AND e.kind IN (${kp}) AND tgt.kind IN (${tp})
5692 AND src.language = 'python' AND src.file_path != ?`
5693 )
5694 .all(filePath, ...kinds, ...targetKinds, filePath) as Array<{ file_path: string }>).map((r) => r.file_path);
5695 }
5696
5697 replaceResolutionEdgesWithUnresolvedRefs(
5698 edgeIds: number[],

Callers 1

Calls 4

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

Tested by

no test coverage detected