Ignore Issues in Blocks not working

In one of our sub-projects, we have defined patterns for ignoring issues in blocks as follows:

Start of block:
\s*\/\/\s*@sonarcloud\s*SKIP_COVERAGE

End of block:
\s*\/\/\s*@sonarcloud\s*END_SKIP_COVERAGE

The intent is to use it as follows:

// @sonarcloud SKIP_COVERAGE
   (untested code here)
// @sonarcloud END_SKIP_COVERAGE

This still reports on test coverage for the block, which is not expected behavior.

Are we misunderstanding how to use this feature?

Thanks!

Hi,

Yes, you are misunderstanding the feature.

Ignoring blocks within a file is available for issues, but nothing else. Coverage exclusions only work at the file level.

 
HTH,
Ann