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

Method getDependentFilePaths

src/db/queries.ts:1795–1805  ·  view source on GitHub ↗

* Distinct file paths that DEPEND ON `filePath`: every file containing a * symbol with a cross-file edge (any kind except `contains`) into a symbol * of this file. This is the file-level projection of the symbol dependency * graph and the basis for blast-radius / `affected` test selection.

(filePath: string)

Source from the content-addressed store, hash-verified

1793 * it. One indexed query (idx_nodes_file_path + idx_edges_target_kind).
1794 */
1795 getDependentFilePaths(filePath: string): string[] {
1796 const sql = `SELECT DISTINCT src.file_path AS fp
1797 FROM edges e
1798 JOIN nodes tgt ON tgt.id = e.target
1799 JOIN nodes src ON src.id = e.source
1800 WHERE tgt.file_path = ?
1801 AND e.kind != 'contains'
1802 AND src.file_path != ?`;
1803 const rows = this.db.prepare(sql).all(filePath, filePath) as Array<{ fp: string }>;
1804 return rows.map((r) => r.fp);
1805 }
1806
1807 /**
1808 * Distinct file paths that `filePath` DEPENDS ON — the inverse of

Callers 1

getFileDependentsMethod · 0.80

Calls 2

allMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected