Issues with code coverage

We have 16 projects in Sonarcloud of which 14 projects functioning as they should with regards to code coverage. Two projects now show 0% code coverage but have worked previously.

After examining differences between the projects we came up empty and decided to remove some code coverage exclusion rules and run a new build. After this it started working again. We even reapplied the code coverage exclusion rules and it worked again as well.

However after new merges to master it stopped working again. Hereby a screenshot of the situation:

The spikes in october last year is when we ‘played’ with the general settings.

Any idea what could cause this situation?

This can happen when the coverage reports are not getting generated correctly, or when the scanner parameters pointing to the coverage reports are not correct. I suggest to review the output of the scanner. It should mention the coverage files imported, paths that it tried, and warnings if it failed to import. If this output looks ok, then I suggest to look into the coverage report files to verify they contain the correct data you would expect.