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

Method getFileImportPairs

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

3500 * and the files of one Go package call each other freely.
3501 */
3502 getFileImportPairs(): Array<{ source: string; target: string }> {
3503 return this.db
3504 .prepare(
3505 `SELECT DISTINCT sn.file_path AS source, tn.file_path AS target
3506 FROM edges e
3507 JOIN nodes sn ON sn.id = e.source
3508 JOIN nodes tn ON tn.id = e.target
3509 WHERE e.kind = 'imports'
3510 AND sn.file_path <> tn.file_path`
3511 )
3512 .all() as Array<{ source: string; target: string }>;
3513 }
3514
3515 /**
3516 * 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