Hello I have setup and been using for some time the following:
SonarQube Server Developer Edition v2025.1.3
It is deployed as a zip
I’m trying to figure out why this rule doesn’t seem to be working correctly: Remove the non-escaped \u0009 character from this literal Rule ID:java:S2479
The rule has a property to allowTabsInTextBlocks which I’ve set to true but scans still pickup tabs, why?
Then I found somewhere else that this rule is getting deprecated or already has?
I’m a bit confused on how to proceed, any help is appreciated.
And I did notice that one of your colleagues mentioned:
To address the issue, you have two options: you can either deactivate the rule as Ann suggested, or adjust the parameter for rule S2479 to allow tabs within text blocks. For both, you need administrator right. I hope one of these solutions helps reduce the noise for you.
I am the full admin on our SonarQube instance and even though I use the `allowTabsInTextBlocks` attribute it still shows up as a finding.
Could I have a screenshot of the issue? Because the reproducer you’ve provided, in addition to apparently not containing \u0009, isn’t a “text block”, which could explain why the rule exception isn’t kicking in for you.
Thanks for for the screenshot; it solves the mystery. You’ve enabled the parameter to “allow tabs in text blocks” but the issue is not being raised on a text block. It’s being raised on a plain, vanilla string. As I alluded earlier, text blocks are delineated by triple quotes (""").
Okay thank you that helps me understand the why. We are limited to Java 8 so text blocks would be something that we couldn’t use/migrate to even if we wanted to right now.
So my only other alternative would be to turn off the rule? Or is there a way to customize it further than the one boolean field?
Unfortunately I’m scanning code written by developers that had to use a SQL client/editor to write what they wanted and then they would copy paste it into Eclipse IDE which would handle tabs, space, etc. by doing what you see above.
Yes we could do what you suggested, I agree 100% and we might move to something like that for any future work. But to satisfy my curiosity, are there ways to customize such rules?