Duplication Exclusions issue - 2025.1.4

Hello Team,

After the recent SonarQube upgrade, we’ve observed an issue with the project-level file exclusion settings. Previously, whenever a Quality Gate failed due to duplicated lines in specific files, we were able to add those files to the project’s exclusion settings (e.g., Duplications Exclusions or General Exclusions). After re-running the pipeline, SonarQube would correctly apply the exclusions and the Quality Gate would pass.

Since the upgrade, this behavior has changed. Even after adding files to the exclusion list within the project settings, SonarQube does not seem to honor these exclusions during analysis, and the Quality Gate continues to fail on the same duplication metrics. This suggests that project-level settings may no longer be taking effect as expected.

below are the Duplication Exclusions but still sonar analysis fails with duplication reason only even after adding these files under Duplication Exclusions list. Kindly assist.

Hi,

Are you saying you’ve just now upgraded to 2025.1? Because that’s last year’s LTA. The current LTA is 2026.1, so you’re not done yet. Keep going. :sweat_smile:

We haven’t made significant changes to the duplication detection algorithm or to its exclusions.

Unfortunately, it’s a bit difficult to diagnose your problem with the exclusions blacked out. Did you specify file paths or patterns? If paths, do they match the paths analysis sees, i.e. the paths as they show up for the files in SonarQube?

 
Ann

Yes you are correct we have just upgraded to 2025.1.4 LTA from 9.9.9 LTA and now planning to migrate to 2026.* .
But After migrating to 2025.1.4 one of our user reported above mentioned issue where he has added files under duplication exclusion to ignore the file/files by duplication detection but in his feature branch is getting scanned that time it seem that this duplication exclusion is not getting applied to this feature branch ,it is only applicable to main branch .And hence scan is failing for this feature branch as duplication is exceeding the limit set at quality gate of hat project . So issue he reported was ,this functionality was working in 9.9.9 version but its not working in 2025.1.4 version as its not considering the duplicate file excusion of the feature branch .
Could you please assist here.

Hi,

Can you verify that the paths in your exclusions screenshot show up the same way in the project’s Code tab?

Also, can you provide the analysis log of the branch in question?

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.

 
Thx,
Ann

@ganncamp FYI the exclusion screenshot is of that specific project . At admin level we are not managing any exclusions.

Any sugession here?

@ganncamp Any update on this ?

HI,

 
Thx,
Ann

Yes….Nothing has changed at code side neither at setting level .Only change here is SonarQube version 9.9.9 to 2025.1.4.
Since the upgrade, even after adding files to the exclusion list within the project settings, SonarQube does not seem to honor these exclusions during analysis, and the Quality Gate continues to fail on the same duplication metrics. This suggests that project-level settings may no longer be taking effect as expected.

Hi,

What I’m asking you is to look at the files in SonarQube and to see what paths SonarQube has them at. And then check those paths against your exclusions.

 
Ann