(
readings: readonly SymbolComplexity[],
architecture: ArchitectureOverviewDto | undefined,
)
| 234 | * summary calls a hotspot from being drawn here with nothing on it. |
| 235 | */ |
| 236 | export function buildComplexityLookup( |
| 237 | readings: readonly SymbolComplexity[], |
| 238 | architecture: ArchitectureOverviewDto | undefined, |
| 239 | ): Map<string, SymbolComplexity> { |
| 240 | const lookup = new Map<string, SymbolComplexity>(); |
| 241 | for (const hotspot of architecture?.hotspots ?? []) { |
| 242 | const key = hotspot.qualifiedName; |
| 243 | if (key) { |
| 244 | lookup.set(key, hotspot); |
| 245 | } |
| 246 | } |
| 247 | for (const reading of readings) { |
| 248 | const key = reading.qualifiedName; |
| 249 | if (!key) { |
| 250 | continue; |
| 251 | } |
| 252 | const known = lookup.get(key); |
| 253 | lookup.set(key, known === undefined ? reading : { ...reading, fanIn: reading.fanIn ?? known.fanIn }); |
| 254 | } |
| 255 | return lookup; |
| 256 | } |
| 257 | |
| 258 | /** |
| 259 | * The whole page from one change set. |
no test coverage detected