I'm stuck with issues for excluded files

  • ALM used : GitHub
  • CI system used GitHub actions
  • Scanner command used : gradle sonar --no-scan --no-rebuild -x test
  • Languages of the repository: kotlin

I first scanned the repo without exclusions, which resulted in several hundred issues. I then excluded a folder, and the number of issues on the summary → overall code page was reduced, but on the “issues” page they are still listed. SonarQube recognizes them as “removed or never existed”, but lists them anyway. Why is that, and how can I solve it?








Some more details: these issues were fist created via automatic analysis in Sonar Cloud. Then I excluded a folder using .sonar-cloud.properties, which set all those issues to FIXED. Then I switched to CI-based analysis, but forgot to exclude that folder, so the issues were reopened. CI-based analysis with exclusions then made the issues disappear from “summary” but persist in “issues”.

I tried to un-exclude the folder again in order to manually set all the issues to FIXED, but I still can’t change their status.

Hi,

This is working exactly as designed. When an issue is fixed in code or removed via configuration changes such as this, we don’t delete it immediately. We move it to a Closed status, which is reflected in your screenshot.

Imagine that you had spent considerable time triaging these issues: commenting on them and adjusting their statuses. Further imagine that, having done this work, you accidentally excluded them and we deleted them immediately. When you corrected your exclusions, all that work would be gone, and you would be… unhappy.

There are other uses cases around this, but the retention here is quite deliberate, and why Issues are filtered on Open by default.

If these issues remain Closed, they’ll be deleted from the DB in 30 days.

 
HTH,
Ann

Ok, thanks

fre. 6. mars 2026, 16:03 skrev G Ann Campbell <notifications@sonarcommunity.discoursemail.com>:

But: they’re not closed, they’re open. That’s my problem

Hi,

Can you try to force an ElasticSearch reindex?

 
Ann

Probably not, we’re on SonarQubeCloud

Hi,

Sorry about that. You already said so when you filed this in the SonarQube Cloud category.

I’m going to flag this for the team.

 
Ann

Thanks!

Hi, are there any news regarding this issue?

Hi Ole,

This behavior is expected in SonarQube Cloud. When you exclude files that were previously scanned, the issues are marked as “Closed (Removed)” rather than being deleted to maintain history.

How to solve it:

  1. Filter your View: On the “Issues” page, check the sidebar filters. Select only “Open” or “Unresolved” statuses.

  2. Verify Status: If the issues show a status of “Removed,” your exclusion is working correctly. They will no longer affect your Quality Gate.

  3. Fresh Start: If you want them gone forever, delete the project in SonarQube Cloud and run your GitHub Action again.

I faced a similar cleanup issue while managing my project at this site, and adjusting the filters was the quickest fix.

Hope this helps!

Hi
Sorry, but no. The issues are not Closed (Removed), they are stuck as Open. Check the third screenshot

Hi @olevold,

I wish I had an update for you. Hopefully one of the experts will be along soon.

 
Ann

1 Like

Looks as if the stuck issues are gone now :bottle_with_popping_cork:

1 Like