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

Function phpIncludeTargets

__tests__/sync-module-config-change.test.ts:147–153  ·  view source on GitHub ↗

The files a PHP file's includes link to.

(graph: CodeGraph, file: string)

Source from the content-addressed store, hash-verified

145
146/** The files a PHP file's includes link to. */
147function phpIncludeTargets(graph: CodeGraph, file: string): string[] {
148 return graph.getNodesInFile(file)
149 .flatMap((n) => graph.getOutgoingEdges(n.id))
150 .filter((e) => e.kind === 'imports' && graph.getNode(e.target)?.kind === 'file')
151 .map((e) => graph.getNode(e.target)!.filePath)
152 .sort();
153}
154
155/** What a full index of C_BEFORE holds under a compile database naming `dir`, which names the folder it's in. */
156async function fullIndexWithDb(dir: string): Promise<string[]> {

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesInFileMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected