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

Function calls

__tests__/cpp-anonymous-union-members.test.ts:143–148  ·  view source on GitHub ↗
(qualifiedName: string)

Source from the content-addressed store, hash-verified

141
142 /** `calls` callees of the function or method `qualifiedName`, as `qualifiedName`. */
143 const calls = (qualifiedName: string): string[] => {
144 const caller = [...cg.getNodesByKind('function'), ...cg.getNodesByKind('method')]
145 .find((n: Node) => n.qualifiedName === qualifiedName);
146 expect(caller, qualifiedName).toBeDefined();
147 return cg.getCallees(caller!.id).filter((r) => r.edge.kind === 'calls').map((r) => r.node.qualifiedName).sort();
148 };
149
150 it("a method defined outside its class reaches the class's union member", () => {
151 expect(calls('google::protobuf::Any::clear_type_url')).toEqual(['google::protobuf::internal::ArenaStringPtr::ClearToEmpty']);

Calls 3

mapMethod · 0.80
getNodesByKindMethod · 0.65
getCalleesMethod · 0.45

Tested by

no test coverage detected