org.sonar.l10n.java.rules.squid.S00121.html Maven / Gradle / Ivy
The newest version!
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
// the two statements seems to be attached to the if statement, but that is only true for the first one:
if (condition)
executeSomething();
checkSomething();
Compliant Solution
if (condition) {
executeSomething();
checkSomething();
}
See
- MISRA C:2004, 14.8
- MISRA C:2004, 14.9
- MISRA C++:2008, 6-3-1
- MISRA C++:2008, 6-4-1
- MISRA C:2012, 15.6
- MITRE, CWE-483 - Incorrect Block Delimitation
© 2015 - 2025 Weber Informatics LLC | Privacy Policy