=== is duplicated by: S1965

=== relates to: S2701

=== on 25 Jul 2013, 10:18:28 Dinesh Bolkensteyn wrote:
Implemented by \http://jira.codehaus.org/browse/SONARJAVA-227

=== on 31 Oct 2013, 16:46:22 Freddy Mallet wrote:
Is implemented by \http://jira.codehaus.org/browse/SONARPLUGINS-3236 for Flex

=== on 25 Nov 2013, 15:09:26 Freddy Mallet wrote:
Is implemented by \http://jira.codehaus.org/browse/SONARPLUGINS-3290 for Javascript

=== on 12 Feb 2014, 18:14:16 Freddy Mallet wrote:
Is implemented by \http://jira.codehaus.org/browse/SONARPLUGINS-3456 for PHP

=== on 1 Oct 2014, 11:53:52 Ann Campbell wrote:
\[~linda.martin] would this rule be appropriate for any of your other languages? E.G. JavaScript?

=== on 9 Oct 2014, 09:03:57 Linda Martin wrote:
\[~ann.campbell.2] I guess you mean the exception ? If so, yes it would definitely be appropriate for JavaScript!

=== on 17 Aug 2015, 16:03:17 Ann Campbell wrote:
\[~dinesh.bolkensteyn] I don't agree with your change to the summary.

On its face it seems to expand the scope of the rule from just conditionals (which the code samples still reflect) to ... everywhere.

OTOH, conditions is the only place they could be redundant, isn't it?


Also, is ``++Boolean++`` (with that spelling/capitalization) a type in every language?

=== on 17 Aug 2015, 16:28:58 Dinesh Bolkensteyn wrote:
I don't think there was a scope extension [~ann.campbell.2] - this behavior is currently implemented in C#, Java and JavaScript (I didn't check the others).


Regarding the type, I've removed the code tags. Boolean seems to be mostly written with an upper-case B, e.g. \https://en.wikipedia.org/wiki/Boolean_data_type

=== on 17 Aug 2015, 20:50:44 Ann Campbell wrote:
\[~dinesh.bolkensteyn] let me be more explicit, the only place booleans can be redundant is in conditional expressions. Let's not make people think through that layer of logic & reinstate old title. 

=== on 18 Aug 2015, 07:00:29 Dinesh Bolkensteyn wrote:
\[~ann.campbell.2]


1. Conditional expression are (in C) of the form ``++foo || bar++`` or ``++foo ? bar : baz++`` - e.g. \https://msdn.microsoft.com/en-us/library/exefbdtf.aspx

2. Relational expressions are of the form ``++foo == bar++``, ``++foo != bar++``, ``++foo > bar++``, etc.

3. Unary expressions are of the form ``++!foo++``, ``++~foo++``, etc.

4. "Condition" typically refers to the expressions that are controlling ``++if++`` or ``++while++`` statements


Now this rule detects issues in all 4 of these points above:


1. ``++foo() || true++``

2. ``++foo() == true++``

3. ``++!false++``

4. ``++if (foo() == true) /* ... */++`` indirectly by the 3 previous cases


All the 3 cases are also detected outside of conditions, such as in method call arguments: ``++myMethod(foo() || true, foo() == true, !false)++``


So I don't think that mentioning or implying that the scope of this rule to "conditions" is accurate.

