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

Function callsFrom

__tests__/js-import-binding-scope.test.ts:34–40  ·  view source on GitHub ↗

The calls made by the function or method with this qualified name, as `kind qualifiedName (file:line)`.

(qualifiedName: string)

Source from the content-addressed store, hash-verified

32
33/** The calls made by the function or method with this qualified name, as `kind qualifiedName (file:line)`. */
34function callsFrom(qualifiedName: string): string[] {
35 const from = [...cg!.getNodesByKind('function'), ...cg!.getNodesByKind('method')].find((n) => n.qualifiedName === qualifiedName);
36 expect(from, `${qualifiedName} should be indexed`).toBeDefined();
37 return cg!.getOutgoingEdges(from!.id).filter((e) => e.kind === 'calls')
38 .map((e) => { const t = cg!.getNode(e.target)!; return `${t.kind} ${t.qualifiedName} (${t.filePath}:${t.startLine})`; })
39 .sort();
40}
41
42afterEach(() => {
43 cg?.close();

Callers 1

Calls 4

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

Tested by

no test coverage detected