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

Function filesNothingReaches

src/graph/dead-code.ts:763–768  ·  view source on GitHub ↗

* Files in the candidate set that nothing else in the index reaches. * * One batched query for the whole set (`getFileDependentCounts` counts through * the symbols, because an `imports` edge points at the imported symbol and a * file node almost never receives one). Zero means nothing else in th

(cg: CodeGraph, filePaths: readonly string[])

Source from the content-addressed store, hash-verified

761 * reaches into this file at all.
762 */
763function filesNothingReaches(cg: CodeGraph, filePaths: readonly string[]): Set<string> {
764 const unique = [...new Set(filePaths)];
765 if (unique.length === 0) return new Set();
766 const dependents = cg.getFileDependentCounts(unique);
767 return new Set(unique.filter((path) => (dependents.get(path) ?? 0) === 0));
768}
769
770/** A file whose contents are declarations for somebody else — see {@link HEADER_EXTENSIONS}. */
771export function isHeaderFile(filePath: string): boolean {

Callers 1

buildDeadCodeReportFunction · 0.85

Calls 2

getMethod · 0.65

Tested by

no test coverage detected