Class CPGEdge


  • public class CPGEdge
    extends Object
    Directed, typed edge between two CPG nodes; identity is (source id, target id, type).
    • Constructor Detail

      • CPGEdge

        public CPGEdge​(CPGNode source,
                       CPGNode target,
                       CPGEdgeType type)
        Creates an edge of the given type.
        Parameters:
        source - the edge source
        target - the edge target
        type - the edge type
      • CPGEdge

        public CPGEdge​(CPGNode source,
                       CPGNode target,
                       CPGEdgeType type,
                       Map<String,​Object> properties)
        Creates an edge of the given type carrying the supplied properties.
        Parameters:
        source - the edge source
        target - the edge target
        type - the edge type
        properties - initial edge properties, may be null
    • Method Detail

      • getSource

        public CPGNode getSource()
        Returns:
        the source
      • getTarget

        public CPGNode getTarget()
        Returns:
        the target
      • getType

        public CPGEdgeType getType()
        Returns:
        the type
      • getProperties

        public Map<String,​Object> getProperties()
        Returns:
        the properties
      • isTainted

        public boolean isTainted()
        Returns:
        whether tainted
      • setTainted

        public void setTainted​(boolean tainted)
        Marks or clears this edge as part of a taint flow.
        Parameters:
        tainted - whether the edge is tainted
      • getProperty

        public Object getProperty​(String key)
        Reads a property value.
        Parameters:
        key - the property key
        Returns:
        the value, or null if absent
      • setProperty

        public void setProperty​(String key,
                                Object value)
        Sets a property value.
        Parameters:
        key - the property key
        value - the value to store
      • hasProperty

        public boolean hasProperty​(String key)
        Tests whether a property is present.
        Parameters:
        key - the property key
        Returns:
        whether the property exists
      • getLabel

        public String getLabel()
        Returns:
        the edge type's short display name
      • 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object