(inputs: readonly SymbolRiskInput[])
| 226 | } |
| 227 | |
| 228 | export function completenessOf(inputs: readonly SymbolRiskInput[]): RiskInputCompleteness { |
| 229 | let measuredCount = 0; |
| 230 | for (const input of inputs) { |
| 231 | if (hasComplexityReadings(input)) { |
| 232 | measuredCount += 1; |
| 233 | } |
| 234 | } |
| 235 | return { |
| 236 | measured: measuredCount, |
| 237 | unmeasured: inputs.length - measuredCount, |
| 238 | total: inputs.length, |
| 239 | }; |
| 240 | } |
| 241 | |
| 242 | /** Order used when a list of levels has to be sorted worst first. */ |
| 243 | export const RISK_ORDER: Readonly<Record<RiskLevel, number>> = { high: 0, medium: 1, low: 2 }; |
no test coverage detected