mirror of
https://github.com/github/codeql.git
synced 2026-01-20 18:04:46 +01:00
30 lines
867 B
XML
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>
|