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

Function targets

__tests__/cpp-alias-inherited-member.test.ts:35–40  ·  view source on GitHub ↗

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

(cg: CodeGraph, qualifiedName: string, kind: 'calls' | 'instantiates')

Source from the content-addressed store, hash-verified

33
34/** What a function's or method's `kind` edges reach, as `qualifiedName @confidence`. */
35function targets(cg: CodeGraph, qualifiedName: string, kind: 'calls' | 'instantiates'): string[] {
36 const from = [...cg.getNodesByKind('method'), ...cg.getNodesByKind('function')].find((n) => n.qualifiedName === qualifiedName)!;
37 return cg.getOutgoingEdgesFrom([from.id], [kind])
38 .map((e) => `${cg.getNode(e.target)?.qualifiedName} @${(e.metadata as { confidence?: number } | undefined)?.confidence}`)
39 .sort();
40}
41
42const NS = 'google::protobuf::conformance';
43const SUITE = lines(

Calls 4

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

Tested by

no test coverage detected