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

Function index

__tests__/require-missing-member.test.ts:29–40  ·  view source on GitHub ↗
(files: Record<string, string>)

Source from the content-addressed store, hash-verified

27});
28
29async function index(files: Record<string, string>): Promise<CodeGraph> {
30 const root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-require-missing-'));
31 roots.push(root);
32 for (const [rel, content] of Object.entries(files)) {
33 const file = path.join(root, rel);
34 fs.mkdirSync(path.dirname(file), { recursive: true });
35 fs.writeFileSync(file, content);
36 }
37 const graph = await CodeGraph.init(root, { index: true });
38 graphs.push(graph);
39 return graph;
40}
41
42/** `caller -> file:qualifiedName` for every `calls` edge out of `file`. */
43function callsFrom(graph: CodeGraph, file: string): string[] {

Callers 1

Calls 3

pushMethod · 0.80
joinMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected