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

Function calls

__tests__/cpp-local-callable-calls.test.ts:48–58  ·  view source on GitHub ↗

`calls` callees of a function or method, constructors aside, as `qualifiedName`, one per callee.

(cg: CodeGraph, caller: string)

Source from the content-addressed store, hash-verified

46
47/** `calls` callees of a function or method, constructors aside, as `qualifiedName`, one per callee. */
48function calls(cg: CodeGraph, caller: string): string[] {
49 return cg
50 .getCallees(callable(cg, caller).id)
51 .filter((r) => r.edge.kind === 'calls')
52 .filter((r) => {
53 const [owner, name] = r.node.qualifiedName.split('::').slice(-2);
54 return owner !== name;
55 })
56 .map((r) => r.node.qualifiedName)
57 .sort();
58}
59
60const lines = (...l: string[]): string => [...l, ''].join('\n');
61

Calls 3

mapMethod · 0.80
callableFunction · 0.70
getCalleesMethod · 0.45

Tested by

no test coverage detected