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

Function edges

__tests__/csharp-declared-receivers.test.ts:310–315  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

308type Row = { k: string; sq: string; q: string; tf: string; line: number; m: string | null };
309
310function edges(): Row[] {
311 const db = (cg as unknown as { db: { getDb(): { prepare(sql: string): { all(...a: unknown[]): Row[] } } } }).db;
312 return db.getDb().prepare(`
313 SELECT e.kind k, s.qualified_name sq, t.qualified_name q, t.file_path tf, e.line line, e.metadata m FROM edges e
314 JOIN nodes s ON s.id = e.source JOIN nodes t ON t.id = e.target`).all();
315}
316
317function callees(caller: string, ref: string): string[] {
318 return edges().filter((e) => e.k === 'calls' && e.sq === caller && JSON.parse(e.m ?? '{}').refName === ref).map((e) => e.q);

Callers 3

calleesFunction · 0.70
linksFunction · 0.70

Calls 3

getDbMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected