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

Create WS measures/search to search for measures on a list of components

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.2
    • Component/s: Measures, Web API
    • Labels:

      Description

      Use case: to be able to display Quality Gates for the favorite projects, several projects must be entered.

      GET api/measures/search

      Parameters

      • projectsKeys: limited to 100 projects (required)
      • metricKeys (required)

      Either componentIds or componentKeys must be provided, not both.
      WS is internal for the time being
      Projects are ordered by name
      Requires 'Browse' permission on the specified projects

      Response example:

      {
        "components": [
          {
            "id": "AVIwDXE-bJbJqrw6wFv5",
            "key": "com.sonarsource:java-markdown:src/main/java/com/sonarsource/markdown/impl/ElementImpl.java",
            "name": "ElementImpl.java",
            "qualifier": "FIL",
            "language": "java",
            "path": "src/main/java/com/sonarsource/markdown/impl/ElementImpl.java",
            "measures": [
              {
                "metric": "new_violations",
                "periods": [
                  {
                    "index": 1,
                    "value": "25"
                  },
                  {
                    "index": 2,
                    "value": "0"
                  },
                  {
                    "index": 3,
                    "value": "25"
                  }
                ]
              },
              {
                "metric": "complexity",
                "value": "12"
              },
              {
                "metric": "ncloc",
                "value": "114"
              }
            ]
          },
          {
            "id": "AVIwDXE_bJbJqrw6wFwJ",
            "key": "com.sonarsource:java-markdown:src/test/java/com/sonarsource/markdown/impl/ElementImplTest.java",
            "name": "ElementImplTest.java",
            "qualifier": "UTS",
            "language": "java",
            "path": "src/test/java/com/sonarsource/markdown/impl/ElementImplTest.java",
            "measures": [
              {
                "metric": "new_violations",
                "periods": [
                  {
                    "index": 1,
                    "value": "0"
                  },
                  {
                    "index": 2,
                    "value": "0"
                  },
                  {
                    "index": 3,
                    "value": "0"
                  }
                ]
              }
            ]
          },
          {
            "id": "AVIwDXE-bJbJqrw6wFv8",
            "key": "com.sonarsource:java-markdown:src/main/java/com/sonarsource/markdown/impl",
            "name": "src/main/java/com/sonarsource/markdown/impl",
            "qualifier": "DIR",
            "path": "src/main/java/com/sonarsource/markdown/impl",
            "measures": [
              {
                "metric": "new_violations",
                "periods": [
                  {
                    "index": 1,
                    "value": "25"
                  },
                  {
                    "index": 2,
                    "value": "0"
                  },
                  {
                    "index": 3,
                    "value": "25"
                  }
                ]
              },
              {
                "metric": "complexity",
                "value": "35",
                "periods": [
                  {
                    "index": 2,
                    "value": "0"
                  }
                ]
              },
              {
                "metric": "ncloc",
                "value": "217",
                "periods": [
                  {
                    "index": 2,
                    "value": "0"
                  }
                ]
              }
            ]
          }
        ]
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                julien.lancelot Julien Lancelot
                Reporter:
                teryk.bellahsene Teryk Bellahsene (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: