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

Method getDependentFilePaths

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

1899 * it. One indexed query (idx_nodes_file_path + idx_edges_target_kind).
1900 */
1901 getDependentFilePaths(filePath: string): string[] {
1902 const sql = `SELECT DISTINCT src.file_path AS fp
1903 FROM edges e
1904 JOIN nodes tgt ON tgt.id = e.target
1905 JOIN nodes src ON src.id = e.source
1906 WHERE tgt.file_path = ?
1907 AND e.kind != 'contains'
1908 AND src.file_path != ?`;
1909 const rows = this.db.prepare(sql).all(filePath, filePath) as Array<{ fp: string }>;
1910 return rows.map((r) => r.fp);
1911 }
1912
1913 /**
1914 * 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