MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / buildComplexityLookup

Function buildComplexityLookup

graph-ui/src/impact/impact-model.ts:236–256  ·  view source on GitHub ↗
(
    readings: readonly SymbolComplexity[],
    architecture: ArchitectureOverviewDto | undefined,
)

Source from the content-addressed store, hash-verified

234 * summary calls a hotspot from being drawn here with nothing on it.
235 */
236export 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.

Callers 3

readImpactFunction · 0.90

Calls 1

getMethod · 0.65

Tested by

no test coverage detected