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

Method getImportTargetsFromFile

src/db/queries.ts:3846–3860  ·  view source on GitHub ↗

The targets, in other files, of the non-synthesized `imports` edges out of the nodes of `filePath`.

(filePath: string)

Source from the content-addressed store, hash-verified

3844
3845 /** The targets, in other files, of the non-synthesized `imports` edges out of the nodes of `filePath`. */
3846 getImportTargetsFromFile(filePath: string): string[] {
3847 return (this.db
3848 .prepare(
3849 `SELECT DISTINCT e.target AS target
3850 FROM nodes src
3851 JOIN edges e ON e.source = src.id
3852 JOIN nodes tgt ON tgt.id = e.target
3853 WHERE src.file_path = ?
3854 AND e.kind = 'imports'
3855 AND (e.provenance IS NULL OR e.provenance != 'heuristic')
3856 AND tgt.file_path != ?`
3857 )
3858 .all(filePath, filePath) as Array<{ target: string }>)
3859 .map((row) => row.target);
3860 }
3861
3862 /**
3863 * The `imports` edges into the node `targetId` from files other than

Callers 1

addPythonImportersFunction · 0.80

Calls 3

mapMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected