CodeQL library for Java/Kotlin
codeql/java-all 4.0.1-dev (changelog, source)
Search

Module DefUse

Provides classes and predicates for def-use and use-use pairs. Built on top of the SSA library for maximal precision.

Import path

import semmle.code.java.dataflow.DefUse

Imports

java

Provides all default Java QL imports.

Predicates

defUsePair

Holds if there exists a path from def to use without passing through another VariableUpdate of the LocalScopeVariable that they both refer to.

parameterDefUsePair

Holds if there exists a path from the entry-point of the callable to use without passing through a VariableUpdate of the parameter p that use refers to.

useUsePair

Holds if use1 and use2 form a use-use-pair of the same SsaSourceVariable, that is, the value read in use1 can reach use2 without passing through any SSA definition of the variable except for phi nodes and uncertain implicit updates.

useUsePairSameVar

Holds if use1 and use2 form a use-use-pair of the same SSA variable, that is, the value read in use1 can reach use2 without passing through any SSA definition of the variable.