CRITICAL
Rule Definition
For performance and readibility reasons, it is preferable to avoid incrementer jumbling in loops because it could be time consuming.
Remediation
Modify the source code to reduce the number of artifacts with incrementer jumbling in loops.
Violation Code Sample
class CastTest
{
public function test($x)
{
for ($i = 0; $i < 10; $i++)
{
for ($k = 0; $k < 20; $i++)
{
echo 'Hello';
}
}
}
}
Reference
Code Sniffer - http://pear.php.net/package/PHP_CodeSniffer/docs/1.5.2/PHP_CodeSniffer/Generic_Sniffs_CodeAnalysis_JumbledIncrementerSniff.html
Related Technologies
Technical Criterion
Complexity - Algorithmic and Control Structure Complexity
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.