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

Function edgesFrom

__tests__/go-conversion-references.test.ts:37–48  ·  view source on GitHub ↗

` : ` of every edge out of the function `fromName`, sorted.

(graph: CodeGraph, fromName: string)

Source from the content-addressed store, hash-verified

35
36/** `<kind> <target kind> <target> :<line>` of every edge out of the function `fromName`, sorted. */
37function edgesFrom(graph: CodeGraph, fromName: string): string[] {
38 const from = graph.getNodesByKind('function').find((n) => n.name === fromName);
39 expect(from, fromName).toBeDefined();
40 return graph
41 .getOutgoingEdges(from!.id)
42 .filter((e) => e.kind === 'calls' || e.kind === 'instantiates' || e.kind === 'references')
43 .map((e) => {
44 const target = graph.getNode(e.target);
45 return `${e.kind} ${target?.kind} ${target?.qualifiedName} :${e.line}`;
46 })
47 .sort();
48}
49
50describe('Go type conversions (#2581)', () => {
51 it("records the issue's `Category(s)` as a use of the type, not a call", async () => {

Calls 4

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

Tested by

no test coverage detected