-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathUnused.qhelp
More file actions
29 lines (24 loc) · 867 Bytes
/
Unused.qhelp
File metadata and controls
29 lines (24 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!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>