About sonarqube metrics response datatype?

Must-share information:

  • Sonarqube 7.1
  • get measures( api/measures/component)web api measures value type is difference metrics type.
  • get measures convert value datatype.

Get components measures response measures value type always is string.

GET api/measures/component

      # value is string.
      {
        "metric": "complexity",
        "value": "12",
        "periods": [
          {
            "index": 1,
            "value": "2"
          }
        ]
      },

    # metric int type
    {
      "key": "complexity",
      "name": "Complexity",
      "description": "Cyclomatic complexity",
      "domain": "Complexity",
      "type": "INT",
      "higherValuesAreBetter": false,
      "qualitative": false,
      "hidden": false,
      "custom": false
    },

Hi,

Thanks for the report. You’re right that this is inconsistent, but we don’t see it as something we want to address.

Ann