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

Function funcFieldCalls

__tests__/go-func-field-dispatch.test.ts:300–310  ·  view source on GitHub ↗

The go-func-field edges out of a function, as `target @registeredAt [field via]`.

(from: Node)

Source from the content-addressed store, hash-verified

298
299/** The go-func-field edges out of a function, as `target @registeredAt [field via]`. */
300function funcFieldCalls(from: Node): string[] {
301 return cg
302 .getOutgoingEdgesFrom([from.id], ['calls'])
303 .filter((e) => meta(e).synthesizedBy === 'go-func-field')
304 .map((e) => {
305 const t = cg.getNode(e.target)!;
306 const m = meta(e);
307 return `${t.qualifiedName} (${t.filePath}) @${String(m.registeredAt)} [${String(m.field)}${m.via ? ` via ${String(m.via)}` : ''}]`;
308 })
309 .sort();
310}
311
312describe('a call through a Go func field reaches the functions put in it', () => {
313 it("links prometheus' refresh to each provider's method, through the Options field it is copied from", () => {

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
metaFunction · 0.70
getOutgoingEdgesFromMethod · 0.45

Tested by

no test coverage detected