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

Function setup

__tests__/resolution.test.ts:3578–3585  ·  view source on GitHub ↗
(files: Record<string, string>)

Source from the content-addressed store, hash-verified

3576 // constant's extent, so `api.call()` resolved to nothing in the defining
3577 // file and to the CONSTANT through an import — zero callers everywhere.
3578 const setup = (files: Record<string, string>) => {
3579 const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'codegraph-1573-'));
3580 for (const [name, content] of Object.entries(files)) {
3581 fs.mkdirSync(path.dirname(path.join(tmpDir, name)), { recursive: true });
3582 fs.writeFileSync(path.join(tmpDir, name), content);
3583 }
3584 return tmpDir;
3585 };
3586 const callersOf = async (cg: CodeGraph, name: string, kind: string, filePath?: string) => {
3587 const target = (await cg.searchNodes(name, { limit: 20 })).find(
3588 (r) => r.node.kind === kind && r.node.name === name && (!filePath || r.node.filePath === filePath)

Callers 2

resolution.test.tsFile · 0.70
mainFunction · 0.50

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected