Edges between two symbols of `file`: what the dominant-file ranking counts.
(g: CodeGraph, file: string)
| 48 | |
| 49 | /** Edges between two symbols of `file`: what the dominant-file ranking counts. */ |
| 50 | function inFileEdges(g: CodeGraph, file: string): number { |
| 51 | return ((g as any).db.db.prepare(` |
| 52 | SELECT COUNT(*) AS n FROM edges e |
| 53 | JOIN nodes s ON e.source = s.id JOIN nodes t ON e.target = t.id |
| 54 | WHERE s.file_path = ? AND t.file_path = ? |
| 55 | `).get(file, file) as { n: number }).n; |
| 56 | } |
| 57 | |
| 58 | /** The issue's layout: the app's two busiest files, below `tests` test files that each outrank both. */ |
| 59 | function appWithTests(tests: number): Record<string, string> { |
no test coverage detected