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

Function ownersOf

__tests__/extraction.test.ts:2716–2723  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

2714 const result = extractFromSource('C.kt', src);
2715 const byId = new Map(result.nodes.map((n) => [n.id, n]));
2716 const ownersOf = (name: string) =>
2717 result.unresolvedReferences
2718 .filter((u) => u.referenceKind === 'calls' && u.referenceName === name)
2719 .map((u) => {
2720 const n = byId.get(u.fromNodeId);
2721 return n ? `${n.kind}:${n.name}` : '?';
2722 })
2723 .sort();
2724 expect(ownersOf('compute')).toEqual(['field:nextLine', 'field:sameLine']);
2725 expect(ownersOf('store')).toEqual(['field:written']);
2726 });

Callers 1

extraction.test.tsFile · 0.70

Calls 2

mapMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected