mirror of
https://github.com/github/codeql.git
synced 2025-12-19 10:23:15 +01:00
30 lines
725 B
XML
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>
|