rspec/rules/S3955/rule.adoc
2022-02-04 16:28:24 +00:00

18 lines
538 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
[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
----