I have been trying to sort out why our code coverage numbers between Visual Studio and SonarQube do not agree. We have integrated SonarQube into our builds and everything seems to be working well. We build the solution in Visual Studio 2015 and then execute unit tests while gathering code coverage. We get the associated .coverage and .coveragexml files normally. The SonarQube process appears to parse the .coveragexml file and upload its contents. However, the reported code coverage values are not in line with the files generated by the testing.

For example, in this project, I see that the CustomSetting class shows 50% coverage as shown in the .coverage file and the .coveragexml file:

The main idea of this article is to highlight the fact that comparing the coverage coming from SonarQube and the coverage coming from other tools is often misleading, SonarQube should be the reference point .

From looking at the specific issue you are mentioning, I see that the set methods are covered and the get ones are not, I’ll try to make a repro and come back on this thread.