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

Method getImportTargetsFromFile

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

3955
3956 /** The targets, in other files, of the non-synthesized `imports` edges out of the nodes of `filePath`. */
3957 getImportTargetsFromFile(filePath: string): string[] {
3958 return (this.db
3959 .prepare(
3960 `SELECT DISTINCT e.target AS target
3961 FROM nodes src
3962 JOIN edges e ON e.source = src.id
3963 JOIN nodes tgt ON tgt.id = e.target
3964 WHERE src.file_path = ?
3965 AND e.kind = 'imports'
3966 AND (e.provenance IS NULL OR e.provenance != 'heuristic')
3967 AND tgt.file_path != ?`
3968 )
3969 .all(filePath, filePath) as Array<{ target: string }>)
3970 .map((row) => row.target);
3971 }
3972
3973 /**
3974 * 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