( tokenScores: Record<string, Record<string, number>>, externalCalls: Record<string, number>, )
| 317 | } |
| 318 | |
| 319 | function boostScoresByExternalCalls( |
| 320 | tokenScores: Record<string, Record<string, number>>, |
| 321 | externalCalls: Record<string, number>, |
| 322 | ): void { |
| 323 | for (const scores of Object.values(tokenScores)) { |
| 324 | for (const token of Object.keys(scores)) { |
| 325 | const numCalls = externalCalls[token] ?? 0 |
| 326 | scores[token] *= 1 + Math.log(1 + numCalls) |
| 327 | scores[token] = Math.round(scores[token] * 1000) / 1000 |
| 328 | } |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | function emptyParsedTokens(skipped: boolean): ParsedTokensForScoring { |
| 333 | return { |
no outgoing calls
no test coverage detected