Discrepancy in project analyses description and component coverage

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
  • what are you trying to achieve
  • what have you tried so far to achieve this

We are trying to fetch the conditions for Quality gate status using the api


we are using the description field of the response from this api
But it shows reason as coverage < 80

But on checking the coverage of the component through api

it is coverage > 80 and also on dashboard coverage is greater than 80

So why is this discrepancy in responses?

The “/api/project_analyses” endpoint returns the results of analysis scans for that project. It will apparently list all the available recorded scans for that project since it was created (I’m guessing somewhat). Obviously, all but one of those scans represents past history, with respect to the data in the current dashboard. Is it possible the first analysis scan in that report is from a period when your project’s coverage was below 80%?

Yes it can be possible but then how to get the latest coverage report through that api


You’re guessing correctly, with the caveat of housekeeping. :slightly_smiling_face:

Why do you need it specifically through that API? As you’ve already seen, you can get the current value from the measures API.


@ganncamp so through the measures api can i get the latest reason of the quality gate status fail for that component


Through the measures api you can get the latest value of a metric. Including… e.g. the current Quality Gate status.

At a guess, you were looking at a no-longer-valid Quality Gate status.