Ares icon indicating copy to clipboard operation
Ares copied to clipboard

Add complex recursion AST check functionality

Open sarpsahinalp opened this issue 2 months ago • 2 comments

Added new JavaParser methods to create a method call graph and detect recursion via cycles in the graph

  • Added UnknownRecursionAssert with hasRecursion(), hasNoRecursion() methods
  • MethodCallGraph class representing the Graph that is produced - VoidVisitorAdapter to traverse the nodes in the CompilationUnit of AST.
  • Added excludeMethods(Method... methods) to exclude wished nodes from the MethodCallGraph
  • Added startingNode(Method method) to determine a starting node, when checking for Recursion within a method, via DFS traverse the tree.
  • Added tests for the correctness of the implementation

sarpsahinalp avatar May 03 '24 16:05 sarpsahinalp