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

Function sourceOf

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

Source from the content-addressed store, hash-verified

2927 // module, which only its file shows; read each file once.
2928 const sources = new Map<string, string | undefined>();
2929 const sourceOf = (filePath: string): string | undefined => {
2930 if (!sources.has(filePath)) {
2931 try { sources.set(filePath, fs.readFileSync(path.join(projectPath, filePath), 'utf-8')); } catch { sources.set(filePath, undefined); }
2932 }
2933 return sources.get(filePath);
2934 };
2935 const collected = groups.map((group) => {
2936 const focus = group[0]!;
2937 const hierarchy = buildTypeHierarchy(cg, focus, { overrides: false });

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected