6.2.5.42. Architecture-LiftedCyclesView

Create a view containing callgraph cycles at module/class level

Required inputs: RFG

This rule identifies cycles in the call graph and adds a corresponding cycles view to the RFG showing these cycles lifted at module or class level according to the given hierarchy view.

A cycle in the call graph bears the risk of infinite recursion at runtime if the termination of the calls is not guaranteed. As a consequence, the entire cycle has to be understood and all conditions must be managed simultaneously as to not induce runtime failure. At the same time, cycles impede understandability of the code for a developer.

If you want to include dynamic calls for function pointers and virtual calls, then manually activate StaticSemanticAnalysis.

This rule does not generate cycle issues (use CycleDetection rules to do so).

Possible Messages

This rule has no predefined messages.

Options

The following places define options that affect this rule: Analysis-GlobalOptions

base_view_name

base_view_name : str = 'Call'

Name of the base view for which cycles should be computed
 

hierarchy_node_predicate

hierarchy_node_predicate : typing.Callable[[_dg.Node], bool] | None = None

A predicate used to filter the module view: only nodes returning True are considered
 

hierarchy_view_name

hierarchy_view_name : str = 'Module'

Name of the module view providing the hierarchy along which the cycles should be lifted.
 

pre_excludes

pre_excludes : set[bauhaus.analysis.config.GlobPattern] = set()

Set of globbing patterns of directories/filenames to exclude before the analysis is performed, i.e. no cycle is reported if the only connecting path goes through a node matching at least one pre_exclude entry
 

result_view_name

result_view_name : str = 'Call Cycles in Level View'

A view of this name will be created (it contains the cycles)
 

selfloops

selfloops : bool = False

Whether only directly recursive elements should be reported as well.