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

Function references

__tests__/csharp-method-groups.test.ts:153–162  ·  view source on GitHub ↗

` -> ` for every `references` edge out of Consumer's methods.

()

Source from the content-addressed store, hash-verified

151
152 /** `<caller> -> <target>` for every `references` edge out of Consumer's methods. */
153 function references(): string[] {
154 const out: string[] = [];
155 for (const m of cg!.getNodesInFile('Consumer.cs').filter((n) => n.kind === 'method' && n.qualifiedName.includes('Consumer::'))) {
156 for (const e of cg!.getOutgoingEdges(m.id).filter((x) => x.kind === 'references')) {
157 const t = cg!.getNode(e.target)!;
158 if (t.kind === 'method') out.push(`${m.name} -> ${t.qualifiedName}`);
159 }
160 }
161 return out.sort();
162 }
163
164 it("links `worker.Run` to Worker's Run, never Runner's, and a property read or a string's method to nothing", () => {
165 expect(references()).toEqual([

Callers 1

Calls 4

getNodeMethod · 0.80
pushMethod · 0.80
getNodesInFileMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected