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

Function calls

__tests__/go-std-method-receivers.test.ts:267–277  ·  view source on GitHub ↗

`file::qualifiedName resolvedBy@confidence` of every method the function `name` in server.go calls.

(name: string)

Source from the content-addressed store, hash-verified

265
266/** `file::qualifiedName resolvedBy@confidence` of every method the function `name` in server.go calls. */
267function calls(name: string): string[] {
268 const fn = cg.getNodesInFile('server/server.go').find((n) => n.name === name && n.kind !== 'method');
269 expect(fn, name).toBeDefined();
270 return cg
271 .getOutgoingEdges(fn!.id)
272 .filter((e) => e.kind === 'calls')
273 .map((e) => ({ e, n: cg.getNode(e.target)! }))
274 .filter(({ n }) => n.kind === 'method')
275 .map(({ e, n }) => `${n.filePath.replace(/\\/g, '/')}::${n.qualifiedName} ${String(e.metadata?.resolvedBy)}@${String(e.metadata?.confidence)}`)
276 .sort();
277}
278
279describe('Go standard method names on a receiver nothing types', () => {
280 it.each([

Callers 1

Calls 4

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

Tested by

no test coverage detected