mirror of
https://github.com/github/codeql.git
synced 2026-03-23 16:06:47 +01:00
31 lines
733 B
XML
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>
|