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

Function bySignature

__tests__/cpp-macro-and-constructor-calls.test.ts:299–303  ·  view source on GitHub ↗
(caller: string)

Source from the content-addressed store, hash-verified

297 const ctorNodes = cg.getNodesByKind('method').filter((n) => n.qualifiedName === 'WithConstructor::WithConstructor');
298 expect(ctorNodes.map((n) => n.signature).sort()).toEqual(['()', '();', '(int value)', '(int value);']);
299 const bySignature = (caller: string) =>
300 cg
301 .getCallees(fn(cg, caller).id)
302 .filter((r) => r.edge.kind === 'calls')
303 .map((r) => `${r.node.kind} ${r.node.qualifiedName}${r.node.signature}`);
304 expect(bySignature('constructor_default')).toEqual(['method WithConstructor::WithConstructor()']);
305 expect(bySignature('constructor_braced')).toEqual(['method WithConstructor::WithConstructor()']);
306 expect(bySignature('constructor_value')).toEqual(['method WithConstructor::WithConstructor(int value)']);

Calls 3

mapMethod · 0.80
fnFunction · 0.70
getCalleesMethod · 0.45

Tested by

no test coverage detected