(fullPath: string, parsed: ParsedTokens)
| 262 | } |
| 263 | |
| 264 | function scoreFileTokens(fullPath: string, parsed: ParsedTokens): FileCallData { |
| 265 | const scores: Record<string, number> = {} |
| 266 | const dirs = path.dirname(fullPath).split(path.sep) |
| 267 | const depth = dirs.length |
| 268 | const tokenBaseScore = |
| 269 | 0.8 ** depth * Math.sqrt(parsed.numLines / (parsed.identifiers.length + 1)) |
| 270 | |
| 271 | for (const identifier of parsed.identifiers) { |
| 272 | if (!IGNORE_TOKENS.includes(identifier)) { |
| 273 | scores[identifier] = tokenBaseScore |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | return { scores, calls: parsed.calls } |
| 278 | } |
| 279 | |
| 280 | function buildTokenCallers( |
| 281 | tokenScores: Record<string, Record<string, number>>, |
no outgoing calls
no test coverage detected