Why is this an issue?

While not technically incorrect, the omission of curly braces can be misleading, and may lead to the introduction of errors during maintenance.

Noncompliant code example

if (condition)  // Noncompliant
  executeSomething();

Compliant solution

if (condition) {
  executeSomething();
}

Exceptions

When the body of an if statement is a single return, break or continue and is on the same line.

Resources