=== deprecates: S3223

=== is related to: S3633

=== is related to: S3651

=== supercedes: S1145


=== on 12 Feb 2015, 09:58:22 Pierre-Yves Nicolas wrote:
We target more advanced cases for the COBOL implementation of that rule where a complex condition is always true or false. In those cases, the solution is not to remove the whole condition but to either remove a sub-condition or change it. We would therefore need a dedicated description for COBOL.

=== on 12 Feb 2015, 13:38:40 Ann Campbell wrote:
Can you rough something out for me [~pierre-yves.nicolas]?

=== on 14 Jul 2016, 18:04:09 Ann Campbell wrote:
\[~nicolas.peru] is this case covered:

https://github.com/google/error-prone/blob/master/docs/bugpattern/EqualsIncompatibleType.md ?

=== on 14 Jul 2016, 18:08:10 Nicolas Peru wrote:
\[~ann.campbell.2] not covered but let's say that : " almost certainly false in most configurations" is not really an incentive to go cover it ;) 

=== on 14 Jul 2016, 19:25:26 Ann Campbell wrote:
\[~nicolas.peru] 

* \https://github.com/google/error-prone/blob/master/docs/bugpattern/IsInstanceOfClass.md 
* \https://github.com/google/error-prone/blob/master/docs/bugpattern/SelfComparison.md
* \https://github.com/google/error-prone/blob/master/docs/bugpattern/SelfEquals.md
?

=== on 19 Jul 2016, 15:54:55 Nicolas Peru wrote:
https://github.com/google/error-prone/blob/master/docs/bugpattern/IsInstanceOfClass.md -> for me this one should have its own dedicated rule.


https://github.com/google/error-prone/blob/master/docs/bugpattern/SelfComparison.md -> this one should indeed probably be supported by SE engine in conjunction with the support of zero (cc [~michael.gumowski]


Last one should be already supported in fact.

=== on 2 May 2019, 17:14:00 Andrei Epure wrote:
The message should be improved, as it is misleading. For example when the boolean expression is part of a chain of ``++OR++`` expressions, the subsequent code will be executed. Therefore _some subsequent code is never executed_ is misleading. (cc [~nicolas.harraudeau])


Example for csharp (which came in https://github.com/SonarSource/sonar-dotnet/issues/2411[issue #2411]). Although this specific example is rather an occurence of S2589 _Boolean expressions should not be gratuitous..._

----
    public void DoTest(Guid guid)
    {
        if (guid == null || guid == Guid.Empty)
            guid = Guid.NewGuid();
    }
----

