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

Module DataFlowPrivate

Import path

import semmle.python.dataflow.new.internal.DataFlowPrivate

Imports

DataFlowDispatch

INTERNAL: Do not use.

IterableUnpacking

The unpacking assignment takes the general form python sequence = iterable where sequence is either a tuple or a list and it can contain wildcards. The iterable can be any iterable, which means that (CodeQL modeling of) content will need to change type if it should be transferred from the LHS to the RHS.

MatchUnpacking

There are a number of patterns available for the match statement. Each one transfers data and content differently to its parts.

StepRelationTransformations

A module for transforming step relations.

Predicates

additionalLambdaFlowStep

Extra data-flow steps needed for lambda flow analysis.

allowParameterReturnInSelf

Holds if flow is allowed to pass from parameter p and back to itself as a side-effect, resulting in a summary from p to itself.

attributeClearStep

Holds if values stored inside attribute c are cleared at node n.

attributeReadStep

Holds if nodeTo is a read of the attribute c of the object nodeFrom.

attributeStoreStep

Holds if nodeFrom flows into the attribute c of nodeTo via an attribute assignment.

clearsContent

Holds if values stored inside content c are cleared at node n. For example, any value stored inside f is cleared at the pre-update node associated with x in x.f = newValue.

compatibleTypes

Holds if t1 and t2 are compatible, that is, whether data can flow from a node of type t1 to a node of type t2.

comprehensionStoreStep

Data flows from an element expression in a comprehension to the comprehension.

dictClearStep
dictStoreStep

Data flows from an element of a dictionary to the dictionary at a specific key.

expectsContent

Holds if the value that is being tracked is expected to be stored inside content c at node n.

forReadStep
forceHighPrecision

Holds if access paths with c at their head always should be tracked at high precision. This disables adaptive access path precision for such access paths.

getCallableScope

Helper for .getEnclosingCallable.

getContentApprox

Gets an approximated value for content c.

getNodeType

Gets the type of node.

isArgumentNode

Holds if arg is an ArgumentNode of c with position pos.

isExpressionNode
isParameterNode

Holds if p is a ParameterNode of c with position pos.

isUnreachableInCall

Holds if the nodes in nr are unreachable when the call context is call.

jumpStep

Holds if pred can flow to succ, by jumping from one callable to another. Additional steps specified by the configuration are not taken into account.

jumpStepNotSharedWithTypeTracker

Set of jumpSteps that are NOT shared with type-tracker implementation.

jumpStepSharedWithTypeTracker

Set of jumpSteps that are shared with type-tracker implementation.

knownSinkModel
knownSourceModel
lambdaCall

Holds if call is a lambda call of kind kind where receiver is the lambda expression.

lambdaCreation

Holds if creation is an expression that creates a lambda of kind kind for c.

listStoreStep

Data flows from an element of a list to the list.

localMustFlowStep
neverSkipInPathGraph

Holds if n should never be skipped over in the PathGraph and in path explanations.

nodeGetEnclosingCallable

Gets the callable in which this node occurs.

nodeIsHidden

Holds if n should be hidden from path explanations.

ppReprType

Gets a string representation of a type returned by getErasedRepr.

readStep

Holds if data can flow from nodeFrom to nodeTo via a read of content c.

readStepCommon

Subset of readStep that should be shared with type-tracking.

runtimeJumpStep

ModuleVariables are accessed via jump steps at runtime.

setStoreStep

Data flows from an element of a set to the set.

simpleLocalFlowStep

This is the local flow predicate that is used as a building block in global data flow.

simpleLocalFlowStepForTypetracking

This is the local flow predicate that is used as a building block in type tracking, it does not include steps from flow summaries.

small_tuple
storeStep

Holds if data can flow from nodeFrom to nodeTo via an assignment to content c.

storeStepCommon

Subset of storeStep that should be shared with type-tracking.

subscriptReadStep

Data flows from a sequence to a subscript of the sequence.

synthDictSplatParameterNodeReadStep

Reads from the synthetic **kwargs parameter to each keyword parameter.

synthStarArgsElementParameterNodeStoreStep
tupleStoreStep

Data flows from an element of a tuple to the tuple at a specific index.

typeStrongerThan
variableCaptureLocalFlowStep

Classes

CastNode

A node that performs a type cast.

DataFlowType
NodeRegion
NonSyntheticPostUpdateNode
PostUpdateNodeImpl
SynthCaptureNode

A synthesized data flow node representing a closure object that tracks captured variables.

SynthDictSplatArgumentNode

A (synthetic) data-flow node that represents all keyword arguments, as if they had been passed in a **kwargs argument.

SynthDictSplatParameterNode

A synthetic data-flow node to allow flow to keyword parameters from a **kwargs argument.

SynthStarArgsElementParameterNode

A (synthetic) data-flow parameter node to capture all positional arguments that should be passed to the *args parameter.

SyntheticPostUpdateNode
SyntheticPreUpdateNode

Datatypes

Modules

LocalFlow

A module to compute local flow.

Orm

INTERNAL: Do not use.

StepRelationTransformations

A module for transforming step relations.

Aliases

ContentApprox

An approximated Content.

DataFlowExpr

An expression

DataFlowSecondLevelScope

The trivial type with a single element.

LambdaCallKind

The trivial type with a single element.

VariableCapture

Provides logic related to captured variables.