Error observed: no error is given, sonar just continues to scan the ignore issue block as if the regex isn’t there
Steps to reproduce: run scanner
Potential workaround: not clear
Per the title, sonarcloud’s ignore issues in blocks feature is not working as expected. Our beginning regex is \/\/ @SONAR_STOP@ and the end regex is \/\/ @SONAR_START@. We would like to use these tags in order to ignore a block of code that uses a third party library, however all the code between the comments // @SONAR_STOP and // @SONAR_START@ is still being scanned. We have also tried using SONAR_STOP, SONAR_START, @SONAR_STOP@, and @SONAR_START@ as tags based on various other forum responses on the issue, however none have worked.
To help you with your problem, I would need to see a screenshot of your analysis scope settings and a listing of the code where the @SONAR_STOP and @SONAR_START comments are embedded.
Please note that the @SONAR_STOP comes before the @SONAR_START. Reversing them is a common error!
Using the same settings as you and similar positioning in a Java file for the comments I was able to test and found no problems.
The only thing I can think of is that elsewhere in your project, either in a sonar-project.properties file, in the pom.xml file or in the command line at the invocation of the scanner, you have parameters that override the UI settings of the form
I was trying the same thing in my project, it seems it’s still saying the part of the code is still uncovered, which is dragging the overall coverage down. Any idea how I should change that?
I’ve tried setting the regex in both UI and the config, neither worked.