Vulnerability Report: Batch fetching by 50 when requesting 100 vulnerabilities
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
We've noticed the complexity of the vulnerability report frequently exceeds the maximum (250 for authenticated user) when requesting 100 results. By default the page size selector (at the bottom of the vulnerability report) is set to 20. But it can be set to 100 as well (and this is persisted in localstorage).
For instance for the project vulnerabilities query, the complexity is 320:
We've removed a couple of unused fields in Remove finding token status unused fields (!212762 - merged) • Lorenz van Herwaarden • 18.6. It's unlikely the query actually hits complexity 320 because this mostly not all fields have values for each vulnerability (think related MR, related issues, severity override, finding token status, ...), but we're likely going to hit the maximum again soon.
Possible solution
Whenever page size is set to 100, we could fetch the results in 2 batches of 50 results. This approximately halves the query complexity. The changes would need to be made in the vulnerability_list_graphql.vue component.
note: when using previous and going back, we need to make sure the 2 batches are also loaded but in the other direction.
note: when the first 50 vulnerabilities are fetched, these need to be shown already while the remaining 50 are being fetched.
