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

Module Flow

Import path

import semmle.python.Flow

Imports

Predicates

Classes

AssignmentExprNode

A control flow node corresponding to an assignment expression such as lhs := rhs.

AttrNode

A control flow corresponding to an attribute expression, such as value.attr

BasicBlock

A basic block (ignoring exceptional flow edges to scope exit)

BinaryExprNode

A control flow node corresponding to a binary expression, such as x + y

BoolExprNode

A control flow node corresponding to a boolean shortcut (and/or) operation

CallNode

A control flow node corresponding to a call expression, such as func(...)

CompareNode

A control flow node corresponding to a comparison operation, such as x<y

ControlFlowNode

A control flow node. Control flow nodes have a many-to-one relation with syntactic nodes, although most syntactic nodes have only one corresponding control flow node. Edges between control flow nodes include exceptional as well as normal control flow.

DefinitionNode

A control flow node corresponding to a definition, that is a control flow node where a value is assigned to this node. Includes control flow nodes for the targets of assignments, simple or augmented, and nodes implicitly assigned in class and function definitions and imports.

DeletionNode

A control flow node corresponding to a deletion statement, such as del x. There can be multiple DeletionNodes for each Delete such that each target has own DeletionNode. The CFG for del a, x.y looks like: NameNode('a') -> DeletionNode -> NameNode('b') -> AttrNode('y') -> DeletionNode.

DictNode

A control flow node corresponding to a dictionary literal, such as { 'a': 1, 'b': 2 }

ForNode

A flow node for a for statement.

IfExprNode

A control flow node corresponding to a conditional expression such as, body if test else orelse

ImportExprNode

A control flow node corresponding to an artificial expression representing an import

ImportMemberNode

A control flow node corresponding to a from ... import ... expression

ImportStarNode

A control flow node corresponding to a from ... import * statement

IterableNode

A control flow node corresponding to an iterable literal. Currently does not include dictionaries, use DictNode directly instead.

ListNode

A control flow node corresponding to a list expression, such as [ 1, 3, 5, 7, 9 ]

NameConstantNode

A control flow node corresponding to a named constant, one of None, True or False.

NameNode

A control flow node corresponding to a (plain variable) name expression, such as var. None, True and False are excluded.

RaiseStmtNode

A flow node for a raise statement

SequenceNode

A control flow node corresponding to a sequence (tuple or list) literal

SetNode

A control flow node corresponding to a set expression, such as { 1, 3, 5, 7, 9 }

StarredNode

A control flow node corresponding to a starred expression, *a.

SubscriptNode

A control flow node corresponding to a subscript expression, such as value[slice]

TupleNode

A control flow node corresponding to a tuple expression such as ( 1, 3, 5, 7, 9 )

UnaryExprNode

A control flow node corresponding to a unary expression: (+x), (-x) or (~x)