You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function get_number_of_issues() from file test_cnes_sonar_scanner.py is not working in case of an issue number superior to 100.
def get_number_of_issues():
"""
Factor out the resquest to get the number of issues of a project on SonarQube
:returns: the number of issues
"""
output = requests.get(f"{cls.SONARQUBE_LOCAL_URL}/api/issues/search?componentKeys={project_key}",
auth=("admin", cls.SONARQUBE_ADMIN_PASSWORD)).json()['issues']
issues = [ issue for issue in output if issue['status'] in ('OPEN', 'TO_REVIEW') ]
return len(issues)
This function does not handle paging of API/issues/search result.
In the case of the VHDL project the return of the query is:
Therefore the query result should be iterate over every 8 pages to return the good number of issues.
In fact, as it is a new project, all the issues should be open . So there won't need iteration around issues to check status.
I think you can simply query to get the total value from paging field.
function get_number_of_issues() from file test_cnes_sonar_scanner.py is not working in case of an issue number superior to 100.
This function does not handle paging of API/issues/search result.
In the case of the VHDL project the return of the query is:
Therefore the query result should be iterate over every 8 pages to return the good number of issues.
In fact, as it is a new project, all the issues should be open . So there won't need iteration around issues to check status.
I think you can simply query to get the total value from paging field.
Originally posted by @LeFl0w in #18 (comment)
The text was updated successfully, but these errors were encountered: