SQ is failing to discover non-compliances with rule c:S1131

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension) Developer Edition v.2025.1.4
  • how is SonarQube deployed: zip
  • what are you trying to achieve: We have a rule c:S1131 “Lines should not end with trailing whitespaces” in our quality profile (and it is enabled) that is not showing up in analysis, but manual check of the code for for the sequence of 1 space followed by a carriage return (which is a non-compliance with rule c:S1131) yields 35 hits.
  • Also we have False positive maintainability issue for the rule c:S1144 for one of the functions in our project.

Any suggestions will be strongly appreciated.

Hi,

Welcome to the community!

Can you check your CI workspace to make sure the trailing spaces actually exist in the code being scanned? I ask because we’ve seen reports of weirdness around whitespace before because there were automatic translations in place (think tabs to spaces). I’m wondering if there’s not an automatic trim in place before analysis hits.

 
Thx,
Ann

Hello Ann, thank you for your reply. We didn’t change our environment lately, and this rule was working correctly on SQ version 8.6, but after the upgrade, this rule isn’t showing this issues anymore.

Hi,

SonarQube 8.6 was a very long time ago indeed. Congrats on your upgrade journey. I’m not surprised you’re seeing some differences in issue detection.

But again, could you please check the file in your CI workspace to make sure the trailing whitespace is indeed present there before I pursue this further?

 
Thx,
Ann