Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some measures in a repsonse from /api/measures/component are not properly parsed #8

Open
sergimola opened this issue Mar 9, 2022 · 0 comments

Comments

@sergimola
Copy link

1 - Make a GET request to https://<SQ_URL>/api/measures/component?component=<ProjectKey>&metricKeys=ncloc, coverage, new_uncovered_conditions, new_vulnerabilities using SonarQubeClient.GetMeasuresComponentAsync.
2 - The raw response from SonarQube is:

{
    "component": {
        "key": "<ProjectKey>",
        "name": "<ProjectName>",
        "qualifier": "TRK",
        "measures": [
            {
                "metric": "coverage",
                "value": "35.6",
                "bestValue": false
            },
            {
                "metric": "new_uncovered_conditions",
                "periods": [
                    {
                        "index": 1,
                        "value": "4298",
                        "bestValue": false
                    }
                ],
                "period": {
                    "index": 1,
                    "value": "4298",
                    "bestValue": false
                }
            },
            {
                "metric": "ncloc",
                "value": "68480"
            },
            {
                "metric": "new_vulnerabilities",
                "periods": [
                    {
                        "index": 1,
                        "value": "1",
                        "bestValue": false
                    }
                ],
                "period": {
                    "index": 1,
                    "value": "1",
                    "bestValue": false
                }
            }
        ]
    }
}

Expected:
ComponentMeasures:

  • coverage = 35.6
  • ncloc = 68480
  • new_uncovered_conditions = 4298
  • new_vulnerabilities = 1

Observed:
ComponentMeasures:

  • coverage = 35.6
  • ncloc = 68480
  • new_uncovered_conditions = null
  • new_vulnerabilities = null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant