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

Function describeOversizeFiles

src/bin/codegraph.ts:1236–1244  ·  view source on GitHub ↗

* One line naming the source files left out of the graph for their size, or * null when there are none. `init`, `index`, `sync` and `status` all say it: * a file over the limit is tracked but never parsed, and until this line the * only sign of that was a search that came back without it. * * T

(files: { path: string; size: number }[])

Source from the content-addressed store, hash-verified

1234 * and the one a reader needs to see.
1235 */
1236function describeOversizeFiles(files: { path: string; size: number }[]): string | null {
1237 if (files.length === 0) return null;
1238 const smallest = [...files].sort((a, b) => a.size - b.size);
1239 const named = smallest.slice(0, 3).map((f) => `${f.path} (${formatFileSize(f.size)})`).join(', ');
1240 const more = files.length > 3 ? ` (+${formatNumber(files.length - 3)} more)` : '';
1241 const one = files.length === 1;
1242 return `${formatNumber(files.length)} source ${one ? 'file is' : 'files are'} over the ${formatFileSize(MAX_SOURCE_FILE_SIZE_BYTES)} size limit and not in the graph ${getGlyphs().dash} ` +
1243 `${one ? 'its' : 'their'} symbols, callers and impact are missing from every answer: ${named}${more}`;
1244}
1245
1246/**
1247 * The `status` warnings for indexed files whose symbols are missing although

Callers 2

printIndexResultFunction · 0.85
mainFunction · 0.85

Calls 5

getGlyphsFunction · 0.90
formatFileSizeFunction · 0.85
mapMethod · 0.80
formatNumberFunction · 0.70
joinMethod · 0.45

Tested by

no test coverage detected