Files
codeql/python/ql/src/Statements/RedundantAssignment.qhelp
2018-11-19 15:10:42 +00:00

30 lines
725 B
XML

<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>Assigning a variable to itself is redundant and often an indication of a mistake in the code.</p>
</overview>
<recommendation>
<p>Check the assignment carefully for mistakes. If the assignment is truly redundant and not simply
incorrect then remove it.</p>
</recommendation>
<example>
<p>In this example the programmer clearly intends to assign to <code>self.eggs</code> but made a
mistake.</p>
<sample src="RedundantAssignment.py" />
</example>
<references>
<li>Python Language Reference: <a href="http://docs.python.org/reference/simple_stmts.html#assignment-statements">
The assignment statement</a>.</li>
</references>
</qhelp>