Files
codeql/cpp/ql/src/Critical/Unused.qhelp
2018-11-12 15:30:19 +00:00

30 lines
867 B
XML

<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
<qhelp>
<overview>
<p>
This query finds variables that are assigned a value but are never read. This is usually an indication of a variable that has been orphaned
due to changes in code, or a defect in the code due to the omission of the unused variable. The unused variables should be
removed to avoid misuse.
</p>
</overview>
<recommendation>
<p>
Examine the code to see if the variable is no longer needed. If it is unnecessary, remove the variable.
Otherwise, update the relevant code to use the variable.
</p>
</recommendation>
<example>
<sample src="Unused.cpp" />
</example>
<references>
<li>SEI CERT C Coding Standard: <a href="https://wiki.sei.cmu.edu/confluence/display/c/MSC13-C.+Detect+and+remove+unused+values">MSC13-C. Detect and remove unused values</a>.</li>
</references>
</qhelp>