CodeQL library for Python
codeql/python-all 1.0.5-dev (changelog, source)
Search

Module Base

Combined points-to and type-inference for “run-time” (as opposed to “import-time” values) The main relation runtime_points_to(node, object, cls, origin) relates a control flow node to the possible objects it points-to the inferred types of those objects and the ‘origin’ of those objects. The ‘origin’ is the point in source code that the object can be traced back to.

This file contains non-layered parts of the points-to analysis.

Import path

import semmle.python.pointsto.Base

Imports

SsaDefinitions

Provides classes and predicates for determining the uses and definitions of variables for ESSA form.

python

Predicates

class_declares_attribute

Holds if this class (not on a super-class) declares name

import_from_dot_in_init

Holds if f is an import of the form from .[...] import ... and the enclosing scope is an init module

test_contains

Hold if expr is a test (a branch) and use is within that test

undefinedVariable

Gets the pseudo-object representing the value referred to by an undefined variable

unknownValue

Gets the pseudo-object representing an unknown value

Modules