Package ghidra.program.util

# 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 Summary

  Constructors
  Constructor
  Description
  `CyclomaticComplexity()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `calculateCyclomaticComplexity(Function function, TaskMonitor monitor)`
  Calculates the cyclomatic complexity of a function by decomposing it into a flow graph using a BasicBlockModel.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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`