Interface CallGraph

All Known Subinterfaces:
MutableCallGraph
All Known Implementing Classes:
GraphBasedCallGraph, OnFlyCallGraph

public interface CallGraph
The interface of all implemented call graph data structures
  • Method Details

    • getMethodSignatures

      @Nonnull Set<MethodSignature> getMethodSignatures()
      This method returns method signatures in the call graph. A method signature is a node in the call graph.
      Returns:
      a set containing all method signatures in the call graph.
    • callTargetsFrom

      @Nonnull Set<MethodSignature> callTargetsFrom(@Nonnull MethodSignature sourceMethod)
      This method returns all method signatures that are called by a given method signature. It returns the targets of outgoing edges of the given node (method signature) in the call graph
      Parameters:
      sourceMethod - the method signature of the requested node in the call graph
      Returns:
      a set of method signatures that are reached by a direct outgoing edge in the call graph
    • callSourcesTo

      @Nonnull Set<MethodSignature> callSourcesTo(@Nonnull MethodSignature targetMethod)
      This method returns all method signatures that call a given method signature. It returns the sources of incoming edges of the given node (method signature) in the call graph
      Parameters:
      targetMethod - the method signature of the requested node in the call graph
      Returns:
      a set of method signatures that reach the targetMethod by a direct edge in the call graph
    • callsFrom

      This method returns all method signatures that are called by a given method signature. It returns the targets of outgoing edges of the given node (method signature) in the call graph
      Parameters:
      sourceMethod - the method signature of the requested node in the call graph
      Returns:
      a set of method signatures that are reached by a direct outgoing edge in the call graph
    • callsTo

      This method returns all method signatures that call a given method signature. It returns the sources of incoming edges of the given node (method signature) in the call graph
      Parameters:
      targetMethod - the method signature of the requested node in the call graph
      Returns:
      a set of method signatures that reach the targetMethod by a direct edge in the call graph
    • containsMethod

      boolean containsMethod(@Nonnull MethodSignature method)
      This method checks if a given method signature is a node in the call graph.
      Parameters:
      method - the method signature of the requested node
      Returns:
      it returns true if the node described by the method signature is included in the call graph, otherwise it will return false.
    • containsCall

      boolean containsCall(@Nonnull MethodSignature sourceMethod, @Nonnull MethodSignature targetMethod, InvokableStmt invokableStmt)
      This method checks if an edge is contained in the call graph. The edge is defined by a source and target method signature which can be nodes in the call graph
      Parameters:
      sourceMethod - it defines the source node in the call graph
      targetMethod - it defines the target node in the call graph
      invokableStmt - it defines the invoke stmt of the call
      Returns:
      true if the edge is contained in the call graph, otherwise it will be false.
    • containsCall

      boolean containsCall(@Nonnull CallGraph.Call call)
      This method checks if an edge is contained in the call graph. The edge is defined by a source and target method signature which can be nodes in the call graph
      Parameters:
      call - it defines the requested call in the call graph
      Returns:
      true if the edge is contained in the call graph, otherwise it will be false.
    • callCount

      int callCount()
      This method counts every edge in the call graph.
      Returns:
      it returns the number of all edges in the call graph.
    • exportAsDot

      String exportAsDot()
      This method converts the call graph object into dot format and write it to a string file.
    • copy

      This method copies a call graph.
      Returns:
      it returns a copied call graph.
    • getEntryMethods

      List<MethodSignature> getEntryMethods()
      This method returns all entry methods of the call graph
      Returns:
      a list of method signatures of entry points of the call graph
    • diff

      This method compares the difference between the current call graph and call graph passed into the argument.