SonarQube
  1. SonarQube
  2. SONAR-2920

No way to retrieve a metric for more than 500 resources in a project

    Details

    • Type: Improvement Improvement
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.11
    • Fix Version/s: None
    • Component/s: Web Services
    • Labels:
      None
    • Number of attachments :
      0

      Description

      There is no longer a way to query all resources for a project using the web API - there is a hardcoded limit of 500 results. Even if the user specifies the limit, only low values are respected: values over 500 are ignored and constrained to 500 at most. This makes certain types of analysis impossible.

      While a default value of 500 for the limit makes sense, it should also be possible for the user to specify the limit and have that respected by the API to retrieve any number of results. If this is not feasible then there should be some other means of retrieving the data; perhaps using multiple requests.

      Also, perhaps the documentation could be updated to reflect the current behaviour. Note that 500 is not the "default" limit ... it is a fixed upper limit
      http://docs.codehaus.org/display/SONAR/Web+Service+API#WebServiceAPI-Resources

      See http://markmail.org/message/iyehbcdaoja2kufw

        Activity

        Hide
        John Smith added a comment -

        Is this gonna be fixed soon?

        Show
        John Smith added a comment - Is this gonna be fixed soon?
        Hide
        Freddy Mallet added a comment -

        Allowing to request more than 500 results might lead to a security issue. So in any case, it must not be possible to override this value through a simple HTTP request but perhaps we should allow a Sonar administrator to change or remove this value on server side.

        Show
        Freddy Mallet added a comment - Allowing to request more than 500 results might lead to a security issue. So in any case, it must not be possible to override this value through a simple HTTP request but perhaps we should allow a Sonar administrator to change or remove this value on server side.
        Hide
        John Smith added a comment -

        Any working solution would be appreciated. In our current project, we have more than 6 000 violations, but due to this limitation, we are unable to retrieve them all

        Show
        John Smith added a comment - Any working solution would be appreciated. In our current project, we have more than 6 000 violations, but due to this limitation, we are unable to retrieve them all
        Hide
        G. Ann Campbell added a comment -

        It's unfortunate that this limit applies to paginated, web-based searches as well. I can only see 500 out of any given subset of reviews using the web search interface. Worse, I have no way of knowing the size of the total set.
        Since I'm only retrieving n out of the set at one time anyway, I should be able to iteratively call this request to see all matches.

        Show
        G. Ann Campbell added a comment - It's unfortunate that this limit applies to paginated, web-based searches as well. I can only see 500 out of any given subset of reviews using the web search interface. Worse, I have no way of knowing the size of the total set. Since I'm only retrieving n out of the set at one time anyway, I should be able to iteratively call this request to see all matches.
        Hide
        Christian Schulz added a comment -

        @Freddy:
        Due the security lag, what do you think about a "page" system?
        So you can get the results 0-500, 501-1000, and so on. The database side should be fast implemented with the LIMIT keyword.

        Show
        Christian Schulz added a comment - @Freddy: Due the security lag, what do you think about a "page" system? So you can get the results 0-500, 501-1000, and so on. The database side should be fast implemented with the LIMIT keyword.

          People

          • Assignee:
            Unassigned
            Reporter:
            Zac Thompson
          • Votes:
            9 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

            • Created:
              Updated: