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

Function callsIn

__tests__/csharp-extension-receivers.test.ts:182–190  ·  view source on GitHub ↗

` :: ` for every call the method `name` in `file` makes.

(file: string, name: string)

Source from the content-addressed store, hash-verified

180
181 /** `<target file>::<name>` for every call the method `name` in `file` makes. */
182 function callsIn(file: string, name: string): string[] {
183 const fn = cg!.getNodesInFile(file).find((n) => n.name === name && n.kind === 'method');
184 expect(fn, `${file} ${name}`).toBeDefined();
185 return cg!
186 .getOutgoingEdges(fn!.id)
187 .filter((e) => e.kind === 'calls')
188 .map((e) => `${cg!.getNode(e.target)!.filePath}::${cg!.getNode(e.target)!.name}`)
189 .sort();
190 }
191
192 it("links each call to its own project's copy", () => {
193 expect(callsIn('A/A.ServiceDefaults/Extensions.cs', 'AddServiceDefaults')).toEqual(['A/A.ServiceDefaults/Extensions.cs::ConfigureTelemetry']);

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesInFileMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected