MCPcopy
hub / github.com/colbymchenry/codegraph / load

Function load

__tests__/lombok.test.ts:32–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30
31 type Row = { name: string; kind: string; decorators: string | null; docstring: string | null; signature: string | null };
32 const load = async () => {
33 const cg = await CodeGraph.init(dir, { silent: true });
34 await cg.indexAll();
35 const db = (cg as any).db.db;
36 const nodes: Row[] = db.prepare(`SELECT name, kind, decorators, docstring, signature FROM nodes`).all();
37 const calls: { src: string; tgt: string }[] = db
38 .prepare(
39 `SELECT s.name src, t.name tgt FROM edges e
40 JOIN nodes s ON s.id = e.source JOIN nodes t ON t.id = e.target
41 WHERE e.kind = 'calls'`
42 )
43 .all();
44 cg.close?.();
45 return { nodes, calls };
46 };
47
48 const isLombok = (n: Row | undefined) => !!n && (n.decorators ?? '').includes('lombok');
49

Callers 1

lombok.test.tsFile · 0.70

Calls 5

initMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65
closeMethod · 0.65
indexAllMethod · 0.45

Tested by

no test coverage detected