Sonar.issue.ignore.block ignores only the first occurence in COBOL sources!

Hello,

We are using SonarQube Enterprise v10.8 (100206) in a Kubernetes environment.

We want to analyze COBOL sources containing generated parts that we wish to exclude from these analyses. The sections of code to be excluded are marked according to the regular expressions defined below.

We are using the following type of sonar-project.properties file:

# Identifiants du projet dans Sonar
sonar.projectKey=dsim-entp:pege:tesae:k19
sonar.projectName=K19
sonar.projectVersion=2026.03.17-SNAPSHOT

# Emplacement des composants
sonar.sources=.
sonar.cobol.file.suffixes=cbl

# Encoding of the source code
sonar.sourceEncoding=iso-8859-1

# Langage
sonar.languages=COBOL

# Calcul du taux de couverture des TU
sonar.tests=./test/
sonar.test.inclusions=**/*.txt
sonar.coverageReportPaths=coverage_sonarqube.xml
sonar.testExecutionReportPaths=testrun_sonarqube.xml
sonar.issue.ignore.block=pregene
sonar.issue.ignore.block.pregene.beginBlockRegexp=\\s{6}\\* DEBUT GENERE
sonar.issue.ignore.block.pregene.endBlockRegexp=\\s{6}\\* FIN   GENERE

Our COBOL sources are organized this way: they contain a sequence of blocks to be ignored or analyzed

      * DEBUT GENERE
        ...
        first COBOL block to ignore
        ...
      * FIN   GENERE
        ...
        Some COBOL code to analyze
        ...
      * DEBUT GENERE
        ...
        second COBOL block to ignore
        ...
      * FIN   GENERE
        ...
        Other COBOL code to analyze
        ...
        and so on
        ...

The issue we are facing is that only the first ignore block is really ignored. All following ignore blocks are analyzed instead of being ignored!

Most of our COBOL sources are made of multiple ignore blocks.

Can you tell us how to fix that and make Sonar ignores all ignore blocks not only the first ones, please?

2 Likes

Hi,

Welcome to the community!

Your version is past EOL. You should update to either the latest version or the current LTA (long-term active version) at your earliest convenience. Your update path is:

10.8 → 2025.1.4 → 2026.1

You may find these resources helpful:

If you have questions about updating, feel free to open a new thread for that here.

If your error persists after update, please come back to us.

 
Ann

Hello,

Thank you Ann for your answer and help on how to update SonarQube.

Best regards,

Fabrice

1 Like