* Calls and type mentions from this symbol that never resolved to a node — a * third-party package, a runtime builtin, a construct extraction doesn't model. * * Without this the callee rail would silently be shorter than the body's call * sites, which reads as "nothing else happens here". Saying
( cg: CodeGraph, nodeId: string )
| 408 | * symbols outside the index" is the honest version of the same screen. |
| 409 | */ |
| 410 | function summarizeOutsideIndex( |
| 411 | cg: CodeGraph, |
| 412 | nodeId: string |
| 413 | ): { |
| 414 | total: number; |
| 415 | byKind: Record<string, number>; |
| 416 | samples: Array<{ name: string; kind: string; line: number; col: number }>; |
| 417 | } { |
| 418 | let refs; |
| 419 | try { |
| 420 | refs = cg.getUnresolvedReferencesFrom(nodeId); |
| 421 | } catch { |
| 422 | return { total: 0, byKind: {}, samples: [] }; |
| 423 | } |
| 424 | |
| 425 | const byKind: Record<string, number> = {}; |
| 426 | for (const ref of refs) byKind[ref.referenceKind] = (byKind[ref.referenceKind] ?? 0) + 1; |
| 427 | |
| 428 | const samples = [...refs] |
| 429 | .sort((a, b) => a.line - b.line || a.column - b.column) |
| 430 | .slice(0, MAX_OUTSIDE_INDEX_SAMPLES) |
| 431 | .map((ref) => ({ |
| 432 | name: ref.referenceName, |
| 433 | kind: ref.referenceKind, |
| 434 | line: ref.line, |
| 435 | col: ref.column, |
| 436 | })); |
| 437 | |
| 438 | return { total: refs.length, byKind, samples }; |
| 439 | } |
| 440 | |
| 441 | // ============================================================================= |
| 442 | // Blast radius |
no test coverage detected