Must-share information (formatted with Markdown):
- which versions are you using: SonarQube 9.9.0 LTS
- how is SonarQube deployed: Helm
- what are you trying to achieve: Access issues through rest API
- what have you tried so far to achieve this: N/A
When I search for issues using the rest API the results are paginated, which is fine. However the response to <server>/api/issues/search?rules=cpp%3AS813&branch=master&ps=500
seems to contain the wrong information for total number of pages. It starts with
{
"total": 53105,
"p": 1,
"ps": 500,
"paging": {
"pageIndex": 1,
"pageSize": 500,
"total": 53105
}
}
The total number of issues is 53105. The page size is 500, so there should be ceil(106.21) = 107
pages. However the page total is 53105, which is obviously wrong.
Obviously it’s quite trivial to calculate this page limit ourselves, so it’s not tragic. However requesting page 107 with &p=107
yields:
{
"errors": [
{
"msg": "Can return only the first 10000 results. 53500th result asked."
}
]
}
While the 10,000 violation API limit is documented it seems like quite a low limit. Especially looking at enterprise licenses with multi-million lines of code. At the very least the pagination API should then print the actual maximum page number (10,000 / 500), which is 20.
Ideally this limit should be set in the SonarQube settings for the project. Since for some projects 10,000 is a lot, for some projects 10,000 is nothing. Since we deploy SonarQube on our own servers it doesn’t make sense that we are limited here.