22 lines
414 B
Plaintext
22 lines
414 B
Plaintext
include::../description.adoc[]
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
$i = $a + $b; // Noncompliant; calculation result not used before value is overwritten
|
|
$i = compute();
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
$i = $a + $b;
|
|
$i += compute();
|
|
----
|
|
|
|
== Exceptions
|
|
|
|
This rule ignores initializations to -1, 0, 1, ``++null++``, ``++true++``, ``++false++``, ``++""++``, ``++[]++`` and ``++array()++``.
|
|
|
|
include::../see.adoc[]
|