Files
codeql/cpp/ql/src/Likely Bugs/ShortLoopVarName.qhelp
2018-08-02 17:53:23 +01:00

31 lines
733 B
XML

<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>This rule finds loops with an iteration variable that has a short name.
The iteration variable of a nested loop should have a descriptive name:
avoid short names like i, j, or k that can cause confusion except in very simple loops.</p>
</overview>
<recommendation>
<p>Change the name of the inner loop's iteration variables to something more descriptive, to make it
easier to understand code in complex, nested loops.</p>
</recommendation>
<example><sample src="ShortLoopVarName.cpp" />
</example>
<references>
<li>
<a href="http://wiki.ros.org/CppStyleGuide#Variables">ROS C++ Style Guide: Variables</a>
</li>
</references>
</qhelp>