Folders missing in SonarCloud coverage


We have configured Microsoft VSTS project with SonarCloud, we have multiple folders in Gitrepo but after analysis is successful, some of the folders are missing in SonarCloud coverage.

Could you please suggest what could be the possible reason for this?

Thank you!

1 Like

Hi Kanika,

on the screenshot that you provide, I see that you are drilling down into the “coverage on new code” metric. This means that you are looking at code which was recently modified only (last 30 days by default on SonarCloud). This might be why you see only a portion of your code base.

If you drill down on the overall coverage, you should see everything.

Thank you for the response.

Just a question, for example, if I have total 10 test cases and out of them 8 passed and 2 failed, and this is integrated in vsTest Assemblies task in VSTS, so will I get the coverage of passed tests in SonarQube or SonarCloud?

If your build definition is configured to not fail the build when there are failed tests, yes, you should end up having the coverage produced by the 8 successful test cases.

We have enabled in such a way, that build task should not fail with failed tests, but we are not getting the Code Coverage. Attaching the screen-shots, please check.

Thanks much for the help!

Just to clarify, are you on SonarQube or SonarCloud? The screenshots you provided tend to indicate that you are on SonarQube. In which case it’s important that you specify which version of SonarQube and the SonarQube extension for TFS you are using.

Hi Fabrice, So we are currently using sonarcloud and doing a poc on soanrqube enterprise 7 version as we are facing some random analysis issues on Cloud.
for the same project (catalog) mentioned above we are facing an issue intermittently both on Cloud and Qube.

Analysis throws an error saying “Failed to find input file”. Although the same files are present in the source code on GitHub. can you please suggest what can be done here.
Whenever this error occurs, code coverage also goes down.

Do we have any update/solution for this “Failed to find input file” error. We are facing this issue constantly now which is impacting our code coverage. Any help is much appreciated.


Could you check that those 2 files are

  • Correctly embedded into your csproj (compiled and visible on the visual studio solution tree)
  • Correctly check’d out on the agent’s filesystem