Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-7135

Create new WS api/measures/component_tree to navigate through components and display measures

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.4
    • Component/s: Web API
    • Labels:
      None

      Description

      The goal is to be able to navigate through components easily and display measures

      • URL: api/measures/component_tree
      • Method: GET
      • Description: Navigate through components based on the chosen strategy. The baseComponentId or the baseComponentKey parameter must be provided. MetricKeys must be provided.
      • Permissions: Requires one of the following permissions:
        • 'Administer System' permission
        • 'Administer' rights on the specified project
        • 'Browse' and 'See Source Code' on the specified project
      • Errors:
        • 404 if the base component is not found
        • 400 if a qualifier is not managed by the platform
        • 400 if the language is unknown
        • 400 if at least one metric from the list does not exist
        • 400 if the metric key of metricSort does not exist
      • Parameters:
        • baseComponentId: base component id. The search is based on this component. The response does not include the component.
        • baseComponentKey: base component key. The search is based on this component. The response does not include the component.
        • strategy:
          • children: return the direct children components of the base component. Grandchildren components are not returned.
          • all: return all the children components of the base component. Grandchildren components are returned.
          • leaves: return all the children components (in general files) which don't have other children. They are the leaves of the component tree.
        • qualifiers: list of qualifiers available with associated meaningful name. By default all the managed qualifiers are returned.
        • q: query on component name or key of the returned components (depends on the strategy)
        • s,asc: sort by component name or path, metric
        • metricKeys: list of metric keys to display for each component
        • metricSort: metric key to sort if the s parameter was provided with 'metric'
        • p, ps: usual paging parameters. Max. 500. Note that paging applies to components and not measures.
        • additionalFields: fields that are not returned by default by the WS but can be:
          • metrics
      • Response fields:
        • components: list of components. The base component is not returned.
          • id: uuid
          • key
          • projectId
          • name
          • qualifier
          • path
          • measures: list of measures. When a component is supposed to have a measure it will be returned (the actual value or the best value if no value)
            • metricKey
            • value: a string, whatever the value
            • valueP1: value for period 1
            • valueP2: value for period 2
            • valueP3: value for period 3
            • valueP4: value for period 4
            • valueP5: value for period 5
        • paging: usual paging fields
        • periods: list of periods, like in api/qualitygates/project_status
        • metrics: list of metrics with details (if additonalFields has metrics)
          • key
          • name
          • description: string
          • domain: string
          • type: string
          • direction: int
          • qualitative: boolean
          • hidden: boolean
          • custom: boolean

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                teryk.bellahsene Teryk Bellahsene (Inactive)
                Reporter:
                teryk.bellahsene Teryk Bellahsene (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: