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

Function callees

__tests__/python-local-scope-calls.test.ts:38–48  ·  view source on GitHub ↗

The `calls` edges out of the function or method with this qualified name, as `name@file`.

(qualified: string)

Source from the content-addressed store, hash-verified

36
37/** The `calls` edges out of the function or method with this qualified name, as `name@file`. */
38function callees(qualified: string): string[] {
39 const from = [...cg!.getNodesByKind('function'), ...cg!.getNodesByKind('method')].filter((n) => n.qualifiedName === qualified);
40 expect(from.length, `${qualified} should be indexed`).toBe(1);
41 return cg!
42 .getOutgoingEdges(from[0]!.id)
43 .filter((e) => e.kind === 'calls')
44 .map((e) => cg!.getNode(e.target))
45 .filter((n): n is NonNullable<typeof n> => !!n)
46 .map((n) => `${n.qualifiedName}@${n.filePath}`)
47 .sort();
48}
49
50describe("a local binding shadows the same file's module function (#3037)", () => {
51 it("the issue's repro, and the assignment, parameter and loop forms", async () => {

Calls 4

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

Tested by

no test coverage detected