SonarCloud picking up new issues on really old code

  • ALM used - GitHub
  • CI system - Github Actions
  • Scanner command used when applicable (private details masked) - N/A
  • Languages of the repository - JS

Hello, on the 23rd Feb 2022, we randomly started seeing 21 new code smells on really old code and they are all the same;

Remove the unused function parameter "variable" or rename it to "_variable" to make intention explicit.

Prior to this, our code smells were 2. I just wanted to know if anything had changed on the Sonar side to bring these errors up? We have not changed anything with Sonar, we have made small changes to nunjucks and json files.

The failing PR and corresponding Sonar Scan is available here

1 day prior to this, there were only 2 code smells.

The timeline can be viewed here https://sonarcloud.io/project/activity?id=DEFRA_rod-licensing

Thanks

1 Like

Hey there.

A new version of our Javascript analyzer was deployed to SonarCloud a few days ago, and indeed included a change to S1172.

Unfortunately on SonarCloud, when analyzers are updated and new issues are raised because of those changes, those new issues are not backdated. This is different from SonarQube which backdates such issues.

There’s unfortunately not much that can be done, except adding this case internally (and I really hope we can do something to improve this, so reports like this are very welcome).

Sorry for the inconvenience.

Ahhh I see. Thank you very much for getting back to me so quickly! Don’t worry, it it didn’t cause any inconvenience! We were just really confused by why it came up. We’ll get it fixed in our code.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.