Class CyclomaticComplexity

java.lang.Object
ghidra.program.util.CyclomaticComplexity

public class CyclomaticComplexity extends Object
Class with a utility function to calculate the cyclomatic complexity of a function.
  • Constructor Details

    • CyclomaticComplexity

      public CyclomaticComplexity()
  • Method Details

    • calculateCyclomaticComplexity

      public int calculateCyclomaticComplexity(Function function, TaskMonitor monitor) throws CancelledException
      Calculates the cyclomatic complexity of a function by decomposing it into a flow graph using a BasicBlockModel.
      Parameters:
      function - the function
      monitor - a monitor
      Returns:
      the cyclomatic complexity
      Throws:
      CancelledException