Package com.tonic.analysis.cpg.edge
Enum CPGEdgeType
- java.lang.Object
-
- java.lang.Enum<CPGEdgeType>
-
- com.tonic.analysis.cpg.edge.CPGEdgeType
-
- All Implemented Interfaces:
Serializable,Comparable<CPGEdgeType>
public enum CPGEdgeType extends Enum<CPGEdgeType>
Kinds of edges a CPG can contain, spanning AST, CFG, data-flow, dependence, call, interprocedural, and taint layers.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ARGUMENTLinks a call site to an expression passed as one of its arguments.AST_CHILDDescends from a syntax node to one nested directly inside it.AST_PARENTAscends from a syntax node to the one enclosing it, the inverse of AST_CHILD.CALLLinks a call site to a method the call may dispatch to.CALLEELinks a method back to a call site that can reach it, the inverse of CALL.CFG_BACKJumps backward to a loop header, closing the cycle that makes the region a loop.CFG_EXCEPTIONTransfers control from a protected instruction to a handler that covers it.CFG_FALSELeaves a conditional along the arm taken when the test fails.CFG_NEXTFalls through from one statement to the next with no branch taken.CFG_TRUELeaves a conditional along the arm taken when the test holds.CONTAINSLinks a declaration to a member declared inside it, such as a class to its methods.CONTROL_DEPThe target executes only under a governing branch, without recording which arm.CONTROL_DEP_FALSEThe target executes only when the governing branch takes its false arm.CONTROL_DEP_TRUEThe target executes only when the governing branch takes its true arm.DATA_DEFLinks an instruction to the value it writes.DATA_USELinks an instruction to a value it reads.EVAL_TYPELinks an expression to the type it evaluates to.INHERITS_FROMLinks a type to a class it extends or an interface it implements.PARAM_INBinds an argument at a call site to the callee's matching formal parameter.PARAM_OUTBinds the callee's returned value back to the call site that receives it.REACHING_DEFConnects a read to a write that can reach it along at least one path, with no intervening redefinition.RECEIVERLinks an instance call to the object it is invoked on.RETURN_VALUELinks a call site to the value the call yields back into the caller.SUMMARYCondenses a callee's input-to-output effect so a flow can cross the call without descending into the body.TAINTUntyped taint edge for flows that fit none of the source, sink, or propagation roles.TAINT_PROPAGATECarries taint one step further, from a tainted node to one it contaminates.TAINT_SINKMarks a node where untrusted data arriving would be a vulnerability.TAINT_SOURCEMarks a node that introduces untrusted data into the graph.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetDescription()StringgetShortName()booleanisASTEdge()booleanisCallGraphEdge()booleanisCFGEdge()booleanisControlDependenceEdge()booleanisDataFlowEdge()booleanisInterproceduralEdge()booleanisTaintEdge()static CPGEdgeTypevalueOf(String name)Returns the enum constant of this type with the specified name.static CPGEdgeType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
AST_CHILD
public static final CPGEdgeType AST_CHILD
Descends from a syntax node to one nested directly inside it.
-
AST_PARENT
public static final CPGEdgeType AST_PARENT
Ascends from a syntax node to the one enclosing it, the inverse of AST_CHILD.
-
CFG_NEXT
public static final CPGEdgeType CFG_NEXT
Falls through from one statement to the next with no branch taken.
-
CFG_TRUE
public static final CPGEdgeType CFG_TRUE
Leaves a conditional along the arm taken when the test holds.
-
CFG_FALSE
public static final CPGEdgeType CFG_FALSE
Leaves a conditional along the arm taken when the test fails.
-
CFG_EXCEPTION
public static final CPGEdgeType CFG_EXCEPTION
Transfers control from a protected instruction to a handler that covers it.
-
CFG_BACK
public static final CPGEdgeType CFG_BACK
Jumps backward to a loop header, closing the cycle that makes the region a loop.
-
DATA_DEF
public static final CPGEdgeType DATA_DEF
Links an instruction to the value it writes.
-
DATA_USE
public static final CPGEdgeType DATA_USE
Links an instruction to a value it reads.
-
REACHING_DEF
public static final CPGEdgeType REACHING_DEF
Connects a read to a write that can reach it along at least one path, with no intervening redefinition.
-
CONTROL_DEP
public static final CPGEdgeType CONTROL_DEP
The target executes only under a governing branch, without recording which arm.
-
CONTROL_DEP_TRUE
public static final CPGEdgeType CONTROL_DEP_TRUE
The target executes only when the governing branch takes its true arm.
-
CONTROL_DEP_FALSE
public static final CPGEdgeType CONTROL_DEP_FALSE
The target executes only when the governing branch takes its false arm.
-
CALL
public static final CPGEdgeType CALL
Links a call site to a method the call may dispatch to.
-
CALLEE
public static final CPGEdgeType CALLEE
Links a method back to a call site that can reach it, the inverse of CALL.
-
ARGUMENT
public static final CPGEdgeType ARGUMENT
Links a call site to an expression passed as one of its arguments.
-
RECEIVER
public static final CPGEdgeType RECEIVER
Links an instance call to the object it is invoked on.
-
RETURN_VALUE
public static final CPGEdgeType RETURN_VALUE
Links a call site to the value the call yields back into the caller.
-
PARAM_IN
public static final CPGEdgeType PARAM_IN
Binds an argument at a call site to the callee's matching formal parameter.
-
PARAM_OUT
public static final CPGEdgeType PARAM_OUT
Binds the callee's returned value back to the call site that receives it.
-
SUMMARY
public static final CPGEdgeType SUMMARY
Condenses a callee's input-to-output effect so a flow can cross the call without descending into the body.
-
EVAL_TYPE
public static final CPGEdgeType EVAL_TYPE
Links an expression to the type it evaluates to.
-
INHERITS_FROM
public static final CPGEdgeType INHERITS_FROM
Links a type to a class it extends or an interface it implements.
-
CONTAINS
public static final CPGEdgeType CONTAINS
Links a declaration to a member declared inside it, such as a class to its methods.
-
TAINT_SOURCE
public static final CPGEdgeType TAINT_SOURCE
Marks a node that introduces untrusted data into the graph.
-
TAINT_SINK
public static final CPGEdgeType TAINT_SINK
Marks a node where untrusted data arriving would be a vulnerability.
-
TAINT_PROPAGATE
public static final CPGEdgeType TAINT_PROPAGATE
Carries taint one step further, from a tainted node to one it contaminates.
-
TAINT
public static final CPGEdgeType TAINT
Untyped taint edge for flows that fit none of the source, sink, or propagation roles.
-
-
Method Detail
-
values
public static CPGEdgeType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (CPGEdgeType c : CPGEdgeType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CPGEdgeType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getShortName
public String getShortName()
- Returns:
- the short name
-
getDescription
public String getDescription()
- Returns:
- the description
-
isASTEdge
public boolean isASTEdge()
- Returns:
- whether this is an AST structure edge
-
isCFGEdge
public boolean isCFGEdge()
- Returns:
- whether this is a control-flow edge
-
isDataFlowEdge
public boolean isDataFlowEdge()
- Returns:
- whether this is a data-flow edge
-
isControlDependenceEdge
public boolean isControlDependenceEdge()
- Returns:
- whether this is a control-dependence edge
-
isCallGraphEdge
public boolean isCallGraphEdge()
- Returns:
- whether this is a call-graph edge
-
isInterproceduralEdge
public boolean isInterproceduralEdge()
- Returns:
- whether this is an interprocedural parameter or summary edge
-
isTaintEdge
public boolean isTaintEdge()
- Returns:
- whether this is a taint edge
-
-