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

Function targets

__tests__/exact-name-binding.test.ts:82–85  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

80 graph = await CodeGraph.init(root);
81 await graph.indexAll();
82 const targets = (name: string) => {
83 const caller = graph!.getNodesByName(name).find(n => n.kind === 'function')!;
84 return graph!.getOutgoingEdges(caller.id).filter(e => e.kind === 'calls').map(e => graph!.getNode(e.target)?.name);
85 };
86 expect(targets('caller')).toContain('original');
87 expect(targets('outer')).toContain('hidden');
88 expect(targets('outside')).not.toContain('hidden');

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesByNameMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected