
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
31 lines
802 B
Plaintext
31 lines
802 B
Plaintext
== Why is this an issue?
|
|
|
|
A conditional operator is sometimes cluttering readability, if one of the operand is a boolean literal it can be simplified in a boolean expression :
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,java]
|
|
----
|
|
boolean a = condition || exp;
|
|
boolean a = !condition && exp;
|
|
boolean a = !condition || exp;
|
|
boolean a = condition && exp;
|
|
----
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== duplicates: S1125
|
|
|
|
=== on 22 Aug 2014, 08:37:01 Nicolas Peru wrote:
|
|
As discussed yesterday, feel free to challenge it.
|
|
|
|
=== on 22 Aug 2014, 19:46:19 Ann Campbell wrote:
|
|
\[~nicolas.peru] I can't think of a way to word this that's not a pure duplicate of RSPEC-1125. I think we should just roll this into that rule. WDYT?
|
|
|
|
endif::env-github,rspecator-view[]
|