20 lines
565 B
Plaintext
20 lines
565 B
Plaintext
== Why is this an issue?
|
|
|
|
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
|
|
|
|
[source,text]
|
|
----
|
|
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
|
|
----
|
|
|
|
|