Class DataFlowSpec

java.lang.Object
org.openrewrite.analysis.dataflow.DataFlowSpec
Direct Known Subclasses:
TaintFlowSpec

@Incubating(since="7.24.0") public abstract class DataFlowSpec extends Object
  • Constructor Details

    • DataFlowSpec

      public DataFlowSpec()
  • Method Details

    • isSource

      public abstract boolean isSource(DataFlowNode srcNode)
      The following is always true: source == cursor.getValue().
      Parameters:
      srcNode - The DataFlowNode to check to determine if it should be considered flow-graph source.
      Returns:
      true if srcNode should be considered the source or root of a flow graph.
    • isSink

      public abstract boolean isSink(DataFlowNode sinkNode)
      The following is always true: sink == cursor.getValue().
      Parameters:
      sinkNode - The DataFlowNode to check to determine if it should be considered a flow-graph sink.
      Returns:
      true if sinkNode should be considered the sink or leaf of a flow graph.
    • isFlowStep

      public final boolean isFlowStep(DataFlowNode srcNode, DataFlowNode sinkNode)
    • isAdditionalFlowStep

      public boolean isAdditionalFlowStep(DataFlowNode srcNode, DataFlowNode sinkNode)
      takes an existing flow-step in the graph and offers a potential next flow step. The method can then decide if the offered potential next flow step should be considered a valid next flow step in the graph. Allows for ad-hoc taint tracking by allowing for additional, non-default flow steps to be added to the flow graph. The following is always true: srcExpression == srcCursor.getValue() && sinkExpression == sinkCursor.getValue().
    • isBarrierGuard

      public boolean isBarrierGuard(Guard guard, boolean branch)
    • isBarrier

      public boolean isBarrier(DataFlowNode node)
      Holds if flow through `expression` is prohibited.