"Condition always true" not detected

Hi,

I just install a fresh docker service from image sonarqube:25.7.0.110598-community with Embeded database for testing.
I use version MSBuildVersion :

 
Version MSBuild 17.11.9+a69bbaaf5 pour .NET Framework
17.11.9.46202

and version SonarScanner.MSBuild :

SonarScanner for MSBuild 10.3
Using the .NET Framework version of the Scanner for MSBuild
Default properties file was found at C:\Users\buu\Documents\AppPortables\SonarQube\sonar-scanner-10.3.0.120579-net-framework\SonarQube.Analysis.xml
Loading analysis properties from C:\Users\buu\Documents\AppPortables\SonarQube\sonar-scanner-10.3.0.120579-net-framework\SonarQube.Analysis.xml

I analyse a C# project and some issues are well detected but I can’t understand why the “Condition always true” is not detected for the code below :

if ((!String.IsNullOrEmpty(input)) && (input != “” && Main.STRING_TO_REPLACE_LIST.Count > 0))

I expect the input != "" to be detected as “Condition always True”, why not?

Note that I’ve previously made some test with image sonarqube:9.9.8-community and the issu was detected on this version.

I think I found the response,
my question is related to warning
warning S2589: Change this condition so that it does not always evaluate to 'true'. (https://rules.sonarsource.com/csharp/RSPEC-2589)
The link describe that this detection is only available in SonarQube Cloud or SonarQube Server “Developper Edition”.

If a Check other link that is detected in my version (like C# static code analysis) I see that they are available in SonarQube Community.

May be the expected rule was remove from Community Edition between 9.9.8 and 25.07?

Thanks

Hi,

In fact, this rule did used to be in Community Edition and was removed at the repackaging to Community Build. Basically, it was a mistake that the removed rules, this one among them, were every exposed in non-commercial editions.

 
HTH,
Ann

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