forked from github/codeql
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUndefinedPlaceHolder.qhelp
More file actions
29 lines (21 loc) · 915 Bytes
/
UndefinedPlaceHolder.qhelp
File metadata and controls
29 lines (21 loc) · 915 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 place-holder variable may not be defined.
If this code is executed and the variable is undefined then a <code>NameError</code> will occur.
</p>
</overview>
<recommendation>
<p>Check that the name of the place-holder variable is not a typographic error.
If the name is correct, either define a value for the variable, or import the module that defines the function or method that sets the value.
</p>
<p>If another module initializes this variable before it is used, then the <code>NameError</code> may not occur.
However, you can make the code more robust and clearer by setting the variable to a default value in its own module.
</p>
</recommendation>
<references>
<li>Python Standard Library: <a href="https://docs.python.org/library/exceptions.html#exceptions.NameError">NameError</a>.</li>
</references>
</qhelp>