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

Function sourceOf

src/bin/codegraph.ts:2834–2839  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

2832 // module, which only its file shows; read each file once.
2833 const sources = new Map<string, string | undefined>();
2834 const sourceOf = (filePath: string): string | undefined => {
2835 if (!sources.has(filePath)) {
2836 try { sources.set(filePath, fs.readFileSync(path.join(projectPath, filePath), 'utf-8')); } catch { sources.set(filePath, undefined); }
2837 }
2838 return sources.get(filePath);
2839 };
2840 const collected = groups.map((group) => {
2841 const focus = group[0]!;
2842 const hierarchy = buildTypeHierarchy(cg, focus, { overrides: false });

Callers 1

mainFunction · 0.85

Calls 4

hasMethod · 0.80
getMethod · 0.65
setMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected