Commit 34309b3
committed
fix(analyzer): deduplicate PE4 findings per line to avoid double-reporting
A line such as `docker.DockerClient(base_url="unix:///var/run/docker.sock")`
matched both the `DockerClient(` and `/var/run/docker.sock` PE4 patterns,
producing two findings for the same vulnerability on the same line.
Collect PE4 candidates in a dict keyed by line number, keeping only the
highest-confidence match, then extend the findings list once. Adds a
regression test that asserts exactly one PE4 finding on such a combined line.
Addresses nit raised in review of PR NVIDIA#189.
Signed-off-by: CharmingGroot <hogeun.choi@vicsnc.com>
Signed-off-by: CharmingGroot <ohyes9711@gmail.com>1 parent b19872d commit 34309b3
2 files changed
Lines changed: 33 additions & 16 deletions
File tree
- src/skillspector/nodes/analyzers
- tests/nodes/analyzers
Lines changed: 15 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
165 | 168 | | |
166 | 169 | | |
167 | 170 | | |
168 | 171 | | |
169 | 172 | | |
170 | 173 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
182 | 185 | | |
| 186 | + | |
183 | 187 | | |
184 | 188 | | |
185 | 189 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
357 | 374 | | |
358 | 375 | | |
359 | 376 | | |
| |||
406 | 423 | | |
407 | 424 | | |
408 | 425 | | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
| 426 | + | |
414 | 427 | | |
415 | 428 | | |
416 | 429 | | |
| |||
0 commit comments