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

Function target

__tests__/frameworks-integration.test.ts:1640–1645  ·  view source on GitHub ↗
(fromName: string, calleeName: string)

Source from the content-addressed store, hash-verified

1638 const cg = await CodeGraph.init(tmpDir, { index: true });
1639 try {
1640 const target = (fromName: string, calleeName: string) => {
1641 const from = cg.getNodesByKind('method').find((n) => n.name === fromName);
1642 expect(from).toBeDefined();
1643 return cg.getOutgoingEdges(from!.id).filter((e) => e.kind === 'calls')
1644 .map((e) => cg.getNode(e.target)).find((t) => t?.name === calleeName);
1645 };
1646 expect(target('check', 'validate')?.startLine).toBe(4);
1647 expect(target('read_one', 'readKey')?.filePath).toBe('app/kafka/one/Manager.scala');
1648 expect(target('read_two', 'readKey')?.filePath).toBe('app/kafka/two/Manager.scala');

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesByKindMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected