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

Function methods

__tests__/ts-declared-callback-parameters.test.ts:51–59  ·  view source on GitHub ↗

The methods the function `name` calls: `Owner::method (file:line) confidence`.

(graph: CodeGraph, name: string)

Source from the content-addressed store, hash-verified

49
50/** The methods the function `name` calls: `Owner::method (file:line) confidence`. */
51function methods(graph: CodeGraph, name: string): string[] {
52 const from = graph.getNodesByKind('function').find((n) => n.name === name);
53 expect(from, `${name} should be indexed`).toBeDefined();
54 return graph.getOutgoingEdges(from!.id).filter((e) => e.kind === 'calls')
55 .map((e) => ({ e, t: graph.getNode(e.target)! }))
56 .filter(({ t }) => t.kind === 'method')
57 .map(({ e, t }) => `${t.qualifiedName} (${t.filePath}:${t.startLine}) ${e.metadata?.confidence}`)
58 .sort();
59}
60
61/** The issue's project. */
62const SCENE = 'export class Scene {\n mutateElement(id: number): number { return id; }\n onlyScene(): void {}\n}\n';

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesByKindMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected