This module can be used to determine the calltree of a program. This can be helpful in understanding which functions calls which other function.

A callgraph is a graph of functions which call eachother.

class ppci.graph.callgraph.CallGraph
ppci.graph.callgraph.mod_to_call_graph(ir_module) → ppci.graph.callgraph.CallGraph

Create a call graph for an ir-module

Calculate the cyclomatic complexity.

Cyclomatic complexity is defined as:

C = E - N + 2 * P

Where: E = number of edges N = number of nodes P = number of connected components.

For functions and procedures P = 1.

So the formula for a single subroutine is:

C = E - N + 2


Determine the cyclomatic complexity of a CFG (control-flow-graph)