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

Module Essa

Library for SSA representation (Static Single Assignment form).

Import path

import semmle.python.essa.Essa

Imports

Classes

ArgumentRefinement

A use of a variable as an argument, foo(v), which might modify the object referred to.

AssignmentDefinition

An assignment to a variable v = val

AttributeAssignment

An assignment of an attribute obj.attr = val

CallsiteRefinement

An implicit (possible) definition of an escaping variable at a call-site

DeletionDefinition

A deletion of a variable del v

EssaAttributeDeletion

A deletion of an attribute del obj.attr.

EssaDefinition

A definition of an extended-SSA (ESSA) variable. There is exactly one definition for each variable, and exactly one variable for each definition.

EssaEdgeRefinement

An ESSA definition corresponding to an edge refinement of the underlying variable. For example, the edges leaving a test on a variable both represent refinements of that variable. On one edge the test is true, on the other it is false.

EssaNodeDefinition

A definition of an ESSA variable that is not directly linked to another ESSA variable.

EssaNodeRefinement

A definition of an ESSA variable that takes another ESSA variable as an input.

EssaVariable

An (enhanced) SSA variable derived from SsaSourceVariable.

ExceptionCapture

A capture of a raised exception except ExceptionType as ex:

ExceptionGroupCapture

A capture of a raised exception group except* ExceptionType as ex:

ImplicitSubModuleDefinition

An implicit definition of the names of sub-modules in a package. Although the interpreter does not pre-define these names, merely populating them as they are imported, this is a good approximation for static analysis.

ImportStarRefinement

A possible redefinition of variable via from ... import *

MethodCallsiteRefinement

An implicit (possible) modification of the object referred at a method call

MultiAssignmentDefinition

An assignment to a variable as part of a multiple assignment ..., v, ... = val

ParameterDefinition

A definition of a variable by declaring it as a parameter

PatternAliasDefinition

A definition of a variable via a pattern alias

PatternCaptureDefinition

A definition of a variable via a capture pattern

PhiFunction

A Phi-function as specified in classic SSA form.

PyEdgeRefinement

A Python specific sub-class of generic EssaEdgeRefinement

ScopeEntryDefinition

A definition of variable at the entry of a scope. Usually this represents the transfer of a global or non-local variable from one scope to another.

SelfCallsiteRefinement

An implicit (possible) modification of self at a method call

SingleSuccessorGuard

A pi-node (guard) with only one successor.

WithDefinition

A definition of a variable in a with statement