1 Star 0 Fork 0

any3ite/codeql

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
UnusedLocalVariable.qhelp 987 Bytes
一键复制 编辑 原始数据 按行查看 历史
<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p> A local variable is defined (by an assignment) but never used.
</p>
<include src="UnusedVariableNaming.inc.qhelp" />
<include src="UnusedTuple.inc.qhelp" />
</overview>
<recommendation>
<p>If the variable is included for documentation purposes or is otherwise intentionally unused, then change its name to indicate that it is unused,
otherwise delete the assignment (taking care not to delete right hand side if it has side effects).</p>
</recommendation>
<example>
<p>In this example, the <code>random_no</code> variable is never read but its assignment
has a side effect. Because of this it is important to remove only the left hand side of the
assignment in line 10.</p>
<sample src="UnusedLocalVariable.py" />
</example>
<references>
<li>Python: <a href="http://docs.python.org/2/reference/simple_stmts.html#assignment-statements">Assignment statements</a>.</li>
</references>
</qhelp>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/any3ite/codeql.git
git@gitee.com:any3ite/codeql.git
any3ite
codeql
codeql
main

搜索帮助