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

Method getFileImportPairs

src/db/queries.ts:3536–3547  ·  view source on GitHub ↗

* Every ordered pair of files where one imports the other, once each: the * graph circular imports are read from. See `src/graph/file-cycles.ts`. * * Only `imports` edges, which the import resolver made from a statement in * the file. Every other cross-file edge says something ran or was

()

Source from the content-addressed store, hash-verified

3534 * and the files of one Go package call each other freely.
3535 */
3536 getFileImportPairs(): Array<{ source: string; target: string }> {
3537 return this.db
3538 .prepare(
3539 `SELECT DISTINCT sn.file_path AS source, tn.file_path AS target
3540 FROM edges e
3541 JOIN nodes sn ON sn.id = e.source
3542 JOIN nodes tn ON tn.id = e.target
3543 WHERE e.kind = 'imports'
3544 AND sn.file_path <> tn.file_path`
3545 )
3546 .all() as Array<{ source: string; target: string }>;
3547 }
3548
3549 /**
3550 * Every unresolved reference recorded in one FILE, ordered by line.

Callers 2

buildMapFunction · 0.45

Calls 2

allMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected