GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • CodeQL documentation
  • CodeQL overview
  • Writing CodeQL queries
  • CodeQL language guides
  • QL language reference
  • CodeQL standard-libraries
  • CodeQL query help
  • CodeQL repository
  • QL publications
  • CodeQL query help for C and C++
  • CodeQL query help for C#
  • CodeQL query help for GitHub Actions
  • CodeQL query help for Go
  • CodeQL query help for Java and Kotlin

This view

  • Original page
  • New address

GeezerVison is showing codeql.github.com — Use of an undefined placeholder variable — CodeQL query help documentation

Use of an undefined placeholder variable¶

ID: py/undefined-placeholder-variable
Kind: problem
Security severity: 
Severity: error
Precision: medium
Tags:
   - quality
   - reliability
   - correctness
Query suites:
   - python-security-and-quality.qls

Click to see the query in the CodeQL repository

This place-holder variable may not be defined. If this code is executed and the variable is undefined then a NameError will occur.

Recommendation¶

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.

If another module initializes this variable before it is used, then the NameError 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.

References¶

  • Python Standard Library: NameError.

  • © GitHub, Inc.
  • Terms
  • Privacy
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.