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

Function callsAt

__tests__/cpp-class-name-receiver-members.test.ts:36–42  ·  view source on GitHub ↗

What the calls at `line` of the function or method `qualifiedName` reach, as `qualifiedName @confidence`.

(cg: CodeGraph, qualifiedName: string, line: number)

Source from the content-addressed store, hash-verified

34
35/** What the calls at `line` of the function or method `qualifiedName` reach, as `qualifiedName @confidence`. */
36function callsAt(cg: CodeGraph, qualifiedName: string, line: number): string[] {
37 const from = [...cg.getNodesByKind('method'), ...cg.getNodesByKind('function')].find((n) => n.qualifiedName === qualifiedName)!;
38 return cg.getOutgoingEdgesFrom([from.id], ['calls'])
39 .filter((e) => e.line === line)
40 .map((e) => `${cg.getNode(e.target)?.qualifiedName} @${(e.metadata as { confidence?: number } | undefined)?.confidence}`)
41 .sort();
42}
43
44const ARENA = lines(
45 'namespace google {',

Calls 4

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

Tested by

no test coverage detected