QL code and tests for C#/C++/JavaScript.

This commit is contained in:
Pavel Avgustinov
2018-08-02 17:53:23 +01:00
commit b55526aa58
10684 changed files with 581163 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>
A variable declaration statement that declares the same variable twice is confusing and hard to
maintain.
</p>
</overview>
<recommendation>
<p>
Remove one of the two declarations. When removing a declaration with an initializer, further changes
may be necessary to ensure that the variable is correctly initialized.
</p>
</recommendation>
<example>
<p>
In the following example, the variable declaration statement declares the variable <code>dom</code>
twice. The second declaration is unnecessary, and since it has no initializer it can simply be
removed.
</p>
<sample src="examples/DuplicateVarDecl.js" />
</example>
<references>
<li>Ecma International, <i>ECMAScript Language Definition</i>, 5.1 Edition, Section 12.2. ECMA, 2011.</li>
</references>
</qhelp>