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

Function riskInputFor

graph-ui/src/impact/impact-model.ts:392–411  ·  view source on GitHub ↗
(
    symbol: ChangeImpactSymbol,
    complexity: ReadonlyMap<string, SymbolComplexity>,
    entryPoints: ReadonlySet<string>,
    tests: ImpactTestLookup,
)

Source from the content-addressed store, hash-verified

390 * completeness count means something.
391 */
392export function riskInputFor(
393 symbol: ChangeImpactSymbol,
394 complexity: ReadonlyMap<string, SymbolComplexity>,
395 entryPoints: ReadonlySet<string>,
396 tests: ImpactTestLookup,
397): SymbolRiskInput {
398 const reading = symbol.qualifiedName ? complexity.get(symbol.qualifiedName) : undefined;
399 const covering = symbol.qualifiedName ? tests.bySymbol.get(symbol.qualifiedName) : undefined;
400 return {
401 isEntryPoint: entryPoints.has(symbol.qualifiedName ?? '') || entryPoints.has(symbol.name),
402 transitiveLoopDepth: reading?.loopDepth,
403 unguardedRecursion: reading?.unguardedRecursion,
404 fanIn: reading?.fanIn,
405 cyclomatic: reading?.complexity,
406 cognitive: reading?.cognitive,
407 allocInLoop: reading?.allocationInLoop,
408 linearScanInLoop: reading?.scanInLoop,
409 testedByCount: covering?.length,
410 };
411}
412
413/**
414 * One phrase per reading that reached a threshold, in the order they matter.

Callers 2

inputForFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected