17 lines
524 B
Plaintext
17 lines
524 B
Plaintext
![]() |
There is no point in creating a branch in the code only to execute an empty statement. Such code can only be due to the presence of an unexpected trailing semi-colon.
|
||
|
|
||
|
|
||
|
== Noncompliant Code Example
|
||
|
|
||
|
----
|
||
|
if(foo); //Noncompliant, the semi-colon must be removed
|
||
|
trigger(action1); // executes unconditionally
|
||
|
else if (bar); //Noncompliant, the semi-colon must be removed
|
||
|
trigger(action2); // executes unconditionally
|
||
|
|
||
|
while (condition); // Noncompliant
|
||
|
doTheThing(); // executes once, unconditionally
|
||
|
----
|
||
|
|
||
|
|