* 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 }[])
| 1234 | * and the one a reader needs to see. |
| 1235 | */ |
| 1236 | function 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 |
no test coverage detected