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

Function callees

__tests__/cpp-block-comment-lines.test.ts:34–39  ·  view source on GitHub ↗

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

(cg: CodeGraph, qualifiedName: string)

Source from the content-addressed store, hash-verified

32
33/** What a function's or method's calls reach, as `qualifiedName @confidence`. */
34function callees(cg: CodeGraph, qualifiedName: string): string[] {
35 const from = [...cg.getNodesByKind('method'), ...cg.getNodesByKind('function')].find((n) => n.qualifiedName === qualifiedName)!;
36 return cg.getOutgoingEdgesFrom([from.id], ['calls'])
37 .map((e) => `${cg.getNode(e.target)?.qualifiedName} @${(e.metadata as { confidence?: number } | undefined)?.confidence}`)
38 .sort();
39}
40
41/** The same, with how each call was resolved. */
42function resolutions(cg: CodeGraph, qualifiedName: string): string[] {

Callers 1

Calls 4

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

Tested by

no test coverage detected