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

Function reachedAt

__tests__/go-declared-receiver.test.ts:271–277  ·  view source on GitHub ↗
(snippet: string)

Source from the content-addressed store, hash-verified

269
270/** What the references on the line holding `snippet` reach: `owner::method (resolvedBy confidence)`. */
271const reachedAt = (snippet: string): string[] => {
272 const line = lineOf(snippet);
273 const ids = cg.getNodesInFile(FILE).map((n) => n.id);
274 return cg.getOutgoingEdgesFrom(ids)
275 .filter((e) => e.kind !== 'contains' && e.line === line)
276 .map((e) => `${cg.getNode(e.target)!.qualifiedName} (${e.metadata?.resolvedBy} ${e.metadata?.confidence})`);
277};
278
279describe('a Go receiver declared through a package', () => {
280 it('reaches the method of the type it is declared as', () => {

Callers 1

Calls 5

mapMethod · 0.80
getNodeMethod · 0.80
lineOfFunction · 0.70
getNodesInFileMethod · 0.65
getOutgoingEdgesFromMethod · 0.45

Tested by

no test coverage detected