(
symbol: ChangeImpactSymbol,
complexity: ReadonlyMap<string, SymbolComplexity>,
entryPoints: ReadonlySet<string>,
tests: ImpactTestLookup,
)
| 390 | * completeness count means something. |
| 391 | */ |
| 392 | export 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. |
no test coverage detected