* For each language, how many files it has and how many yielded a symbol: a * node other than the file's own. More than one stored node settles a row, so * `nodes` is only probed for the few it can't, such as a file whose one symbol * came from a framework pass. Probing every row costs as m
()
| 5919 | * getStats() either way, because every explore runs that. |
| 5920 | */ |
| 5921 | getParsedFileCounts(): Array<{ language: Language; files: number; parsed: number }> { |
| 5922 | return this.db |
| 5923 | .prepare(` |
| 5924 | SELECT f.language AS language, COUNT(*) AS files, |
| 5925 | SUM(CASE |
| 5926 | WHEN f.node_count > 1 THEN 1 |
| 5927 | WHEN EXISTS (SELECT 1 FROM nodes n WHERE n.file_path = f.path AND n.kind <> 'file') THEN 1 |
| 5928 | ELSE 0 |
| 5929 | END) AS parsed |
| 5930 | FROM files f |
| 5931 | GROUP BY f.language |
| 5932 | ORDER BY f.language |
| 5933 | `) |
| 5934 | .all() as Array<{ language: Language; files: number; parsed: number }>; |
| 5935 | } |
| 5936 | |
| 5937 | /** |
| 5938 | * Get graph statistics |
no test coverage detected