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

Function resolutions

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

The same, with how each call was resolved.

(cg: CodeGraph, qualifiedName: string)

Source from the content-addressed store, hash-verified

40
41/** The same, with how each call was resolved. */
42function resolutions(cg: CodeGraph, qualifiedName: string): string[] {
43 const from = [...cg.getNodesByKind('method'), ...cg.getNodesByKind('function')].find((n) => n.qualifiedName === qualifiedName)!;
44 return cg.getOutgoingEdgesFrom([from.id], ['calls'])
45 .map((e) => {
46 const meta = e.metadata as { confidence?: number; resolvedBy?: string } | undefined;
47 return `${cg.getNode(e.target)?.qualifiedName} @${meta?.confidence} ${meta?.resolvedBy}`;
48 })
49 .sort();
50}
51
52const SHAPES = lines(
53 'class Widget {',

Callers 1

Calls 4

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

Tested by

no test coverage detected