* 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
()
| 5800 | * getStats() either way, because every explore runs that. |
| 5801 | */ |
| 5802 | getParsedFileCounts(): Array<{ language: Language; files: number; parsed: number }> { |
| 5803 | return this.db |
| 5804 | .prepare(` |
| 5805 | SELECT f.language AS language, COUNT(*) AS files, |
| 5806 | SUM(CASE |
| 5807 | WHEN f.node_count > 1 THEN 1 |
| 5808 | WHEN EXISTS (SELECT 1 FROM nodes n WHERE n.file_path = f.path AND n.kind <> 'file') THEN 1 |
| 5809 | ELSE 0 |
| 5810 | END) AS parsed |
| 5811 | FROM files f |
| 5812 | GROUP BY f.language |
| 5813 | ORDER BY f.language |
| 5814 | `) |
| 5815 | .all() as Array<{ language: Language; files: number; parsed: number }>; |
| 5816 | } |
| 5817 | |
| 5818 | /** |
| 5819 | * Get graph statistics |
no test coverage detected