All Downloads are FREE. Search and download functionalities are using the official Maven repository.

resources.report.rules.pmd.ForLoopsMustUseBraces.html Maven / Gradle / Ivy



ForLoopsMustUseBraces

ForLoopsMustUseBraces

Avoid using ‘for’ statements without using curly braces. If the code formatting or indentation is lost then it becomes difficult to separate the code being controlled from the rest.

 
//ForStatement[not(Statement/Block)]
 

Example(s):


for (int i = 0; i < 42; i++)
   foo();





© 2015 - 2024 Weber Informatics LLC | Privacy Policy