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

Function calls

__tests__/cpp-two-line-receivers.test.ts:35–43  ·  view source on GitHub ↗

What a function's or method's calls reach, as `qualifiedName resolvedBy@confidence`.

(cg: CodeGraph, qualifiedName: string)

Source from the content-addressed store, hash-verified

33
34/** What a function's or method's calls reach, as `qualifiedName resolvedBy@confidence`. */
35function calls(cg: CodeGraph, qualifiedName: string): string[] {
36 const from = [...cg.getNodesByKind('method'), ...cg.getNodesByKind('function')].find((n) => n.qualifiedName === qualifiedName)!;
37 return cg.getOutgoingEdgesFrom([from.id], ['calls'])
38 .map((e) => {
39 const meta = e.metadata as { confidence?: number; resolvedBy?: string } | undefined;
40 return `${cg.getNode(e.target)?.qualifiedName} ${meta?.resolvedBy}@${meta?.confidence}`;
41 })
42 .sort();
43}
44
45const TABLES = lines(
46 '#include <memory>',

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesByKindMethod · 0.65
getOutgoingEdgesFromMethod · 0.45

Tested by

no test coverage detected