Commit f8da885
committed
feat: parser refactoring, Jedi call resolution, and performance optimizations
Major improvements to code-review-graph spanning parser architecture,
call graph accuracy, and build performance.
Parser refactoring:
- Extract 16 per-language handler modules into code_review_graph/lang/
using a strategy pattern, replacing monolithic conditionals in parser.py
- Thread-safe parser caches with double-check locking
Call graph enrichment:
- Jedi-based Python method call resolution at build time (jedi_resolver.py)
- Pre-scan filtering by project function names (36s to 3s on large repos)
- Typed variable call enrichment (Python, JS/TS, Kotlin/Java)
- Star import resolution, namespace imports, CommonJS require()
- Angular template parsing, JSX handler tracking
- Module-level import tracking and module-qualified call resolution
- Function/class references passed as call arguments
PreToolUse search enrichment:
- New enrich.py module and code-review-graph enrich CLI command
- Injects graph context (callers, flows, community, tests) into agent
search results passively via hook
Dead code false positive reduction:
- Framework decorators recognized as entry points
- CDK construct methods, abstract overrides excluded
- E2e test directories excluded from dead code detection
Performance:
- Community detection: 48.6s to 2.3s (21x speedup) via bulk node
loading and adjacency-indexed cohesion computation
- Jedi enrichment: 36s to 3s (12x) via pre-scan filtering
- Batch file storage (50-file transactions)
- Batch risk_index (2 GROUP BY queries replace per-node loops)
Other:
- Weighted flow risk scoring by criticality
- Transitive TESTED_BY lookup for tests_for and risk scoring
- DB schema v8: composite edge index (v7 reserved by PR #127)
- --quiet and --json CLI flags
- Search query deduplication, test function deprioritization
- New [enrichment] optional dependency group for Jedi
- 829+ tests across 26 test files (up from 615)
Evaluated against Gadgetbridge (41k nodes, 280k edges): 8/10 PASS,
call resolution rate improved from 28% to 39.6%.1 parent 7093e56 commit f8da885
File tree
73 files changed
+9831
-1670
lines changed- code-review-graph-vscode/src/backend
- code_review_graph
- lang
- tools
- docs
- tests
- fixtures
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
73 files changed
+9831
-1670
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
111 | 133 | | |
112 | 134 | | |
113 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
114 | 150 | | |
115 | 151 | | |
116 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
| |||
296 | 297 | | |
297 | 298 | | |
298 | 299 | | |
| 300 | + | |
299 | 301 | | |
300 | 302 | | |
301 | 303 | | |
| |||
319 | 321 | | |
320 | 322 | | |
321 | 323 | | |
322 | | - | |
| 324 | + | |
323 | 325 | | |
324 | 326 | | |
325 | 327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 56 | + | |
65 | 57 | | |
66 | 58 | | |
67 | 59 | | |
68 | 60 | | |
69 | 61 | | |
70 | 62 | | |
71 | | - | |
| 63 | + | |
72 | 64 | | |
73 | 65 | | |
74 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
| 215 | + | |
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
165 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
166 | 170 | | |
167 | 171 | | |
168 | 172 | | |
| |||
179 | 183 | | |
180 | 184 | | |
181 | 185 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
186 | 190 | | |
187 | 191 | | |
188 | 192 | | |
| |||
0 commit comments