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

Method getDependencyFilePaths

src/db/queries.ts:3668–3678  ·  view source on GitHub ↗

* Distinct file paths that `filePath` DEPENDS ON — the inverse of * getDependentFilePaths: every file containing a symbol that a * symbol of this file has a cross-file edge into. Same edge-kind rules * (all kinds except `contains`); same reason imports-only is insufficient.

(filePath: string)

Source from the content-addressed store, hash-verified

3666 * (all kinds except `contains`); same reason imports-only is insufficient.
3667 */
3668 getDependencyFilePaths(filePath: string): string[] {
3669 const sql = `SELECT DISTINCT tgt.file_path AS fp
3670 FROM edges e
3671 JOIN nodes src ON src.id = e.source
3672 JOIN nodes tgt ON tgt.id = e.target
3673 WHERE src.file_path = ?
3674 AND e.kind != 'contains'
3675 AND tgt.file_path != ?`;
3676 const rows = this.db.prepare(sql).all(filePath, filePath) as Array<{ fp: string }>;
3677 return rows.map((r) => r.fp);
3678 }
3679
3680 /**
3681 * Cross-file edges whose TARGET is a node in `filePath` and whose SOURCE is a

Callers 1

getFileDependenciesMethod · 0.80

Calls 3

mapMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected