(path: string)
| 35 | ? Math.max(degree.get(path) ?? 0, ...['c', 'cc', 'cpp', 'cxx'].map(extension => degree.get(path.replace(/\.(h|hpp)$/, `.${extension}`)) ?? 0)) |
| 36 | : degree.get(path) ?? 0; |
| 37 | const score = (path: string) => (/\/README\.md$/i.test(path) ? 30000 : 0) + (/\.(h|hpp)$/.test(path) ? 10000 : 0) + (path.split('/').at(-1)?.split('.')[0] === part ? 20000 : 0) |
| 38 | + Math.min(5000, connectedness(path)) - path.split('/').length; |
| 39 | return area.files.filter(path => /\.(h|hpp|c|cc|cpp|cxx|ts|tsx|js|jsx|py|rs|go|java|cs|md)$/.test(path)) |
| 40 | .sort((a, b) => score(b) - score(a) || a.localeCompare(b)).slice(0, 2); |
| 41 | } |
no test coverage detected