Commit 2cebba1
authored
fix: restore complexity/CFG/dataflow analysis in builds (#469)
* fix: restore complexity/CFG/dataflow analysis in builds (#468)
Two bugs fixed:
1. Broken import paths in ast-analysis/engine.js — the buildXxx
functions (buildComplexityMetrics, buildCFGData, buildDataflowEdges,
buildAstNodes) were imported as ../complexity.js etc. which resolved
to non-existent src/complexity.js instead of src/features/complexity.js.
The dynamic imports failed silently inside try/catch, so all analysis
tables (function_complexity, cfg_blocks, dataflow) were always empty
on every build — both full and incremental, both engines.
2. Missing WASM tree pre-parse for native engine incremental rebuilds —
ensureWasmTrees was only called when dataflow needed it, but
complexity and CFG visitors also require a WASM tree. On native
incremental rebuilds, changed files had their analysis data purged
but never re-computed because no WASM tree was available for the
visitor walk.
Impact: 1 functions changed, 0 affected
* fix: align needsCfg gate with walk guard and prevent vacuous test passes
Add d.cfg !== null check to needsCfg predicate, matching the unified
walk guard and avoiding unnecessary WASM loading for null-CFG defs.
Fix wrong column names in readAnalysisTables (node_id -> function_node_id,
source_node_id -> source_id) that caused CFG/dataflow queries to silently
return empty arrays. Add toBeGreaterThan(0) assertions so these tests
fail fast if analysis data is missing.
Impact: 1 functions changed, 0 affected
* fix: add complexity extension filter and guard db.close with finally
Impact: 1 functions changed, 0 affected1 parent f0770f5 commit 2cebba1
2 files changed
Lines changed: 93 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
77 | | - | |
78 | | - | |
79 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
84 | | - | |
85 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
86 | 106 | | |
87 | 107 | | |
88 | 108 | | |
| |||
320 | 340 | | |
321 | 341 | | |
322 | 342 | | |
323 | | - | |
| 343 | + | |
324 | 344 | | |
325 | 345 | | |
326 | 346 | | |
| |||
331 | 351 | | |
332 | 352 | | |
333 | 353 | | |
334 | | - | |
| 354 | + | |
335 | 355 | | |
336 | 356 | | |
337 | 357 | | |
| |||
342 | 362 | | |
343 | 363 | | |
344 | 364 | | |
345 | | - | |
| 365 | + | |
346 | 366 | | |
347 | 367 | | |
348 | 368 | | |
| |||
353 | 373 | | |
354 | 374 | | |
355 | 375 | | |
356 | | - | |
| 376 | + | |
357 | 377 | | |
358 | 378 | | |
359 | 379 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
46 | 89 | | |
47 | 90 | | |
48 | 91 | | |
| |||
103 | 146 | | |
104 | 147 | | |
105 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
106 | 170 | | |
0 commit comments