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

Function methodCallees

__tests__/python-module-attribute-local.test.ts:35–45  ·  view source on GitHub ↗

The methods a function calls, as `Class::method@file`.

(fn: string)

Source from the content-addressed store, hash-verified

33
34/** The methods a function calls, as `Class::method@file`. */
35function methodCallees(fn: string): string[] {
36 const from = cg!.getNodesByKind('function').find((n) => n.qualifiedName === fn);
37 expect(from, `${fn} should be indexed`).toBeDefined();
38 return cg!
39 .getOutgoingEdges(from!.id)
40 .filter((e) => e.kind === 'calls')
41 .map((e) => cg!.getNode(e.target))
42 .filter((n): n is NonNullable<typeof n> => !!n && n.kind === 'method')
43 .map((n) => `${n.qualifiedName}@${n.filePath}`)
44 .sort();
45}
46
47const CLIENT = [
48 'class Client:',

Calls 4

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

Tested by

no test coverage detected