6.2.5.45. Architecture-VariantDeadCode

Report dead code findings considering several client projects (i.e. findings that appear in all projects)

Required inputs: RFG

This rule calculates the views dead_view_name and alive_view_name.

First, dead and alive code for the /Project/rfg is calculated and used to initialize dead_view_name and alive_view_name.

Then, for each RFG in project_rfgs, the alive code is calculated and subtracted from dead_view_name and added to alive_view_name.

RFGs in project_rfgs that cannot be loaded, or do not contain the views base_view_name and entries_view_name, are ignored.

Possible Messages

This rule has no predefined messages.

Options

advanced

Options that are normally not required.
 

advanced.attributes_for_identity : set[str] = {'Linkage.Name'}

Attribute names that are used to establish identity of nodes across the RFGs. Linkage.Name is always added, even if it is removed by configuration.
 

advanced.attributes_to_copy : set[str] = {'Linkage.Is_Definition', 'Linkage.Name', 'Source.Column', 'Source.File', 'Source.Line', 'Source.Name', 'Source.Path'}

Attribute names to copy from the nodes of the additional RFGs when creating the Alive in some Variants view (attributes must exist in all RFGs consistently). Linkage.Name is always added, even if it is removed by configuration.
 

alive_view_name

alive_view_name : str = 'Alive in some Variants'

Name of the result view containing the alive functions.
 

base_view_name

base_view_name : str = 'Code Facts'

Name of the base views of the involved projects in which to search for dead code.
 

dead_view_name

dead_view_name : str = 'Dead in all Variants'

Name of the result view containing the dead functions.
 

entries_view_name

entries_view_name : str = 'Entries'

Name of the entries views of the involved projects, which provide the entry points for alive functions.
 

export_warnings

export_warnings : bool = True

Export output messages to the analysis database.
 

loglevel

loglevel : LogLevel = 'WARNING'

Logging mode. WARNING only outputs errors and warnings, INFO additionally prints info messages, DEBUG additionally outputs info and debug messages.
 

merge_copies

merge_copies : bool = True

Whether all copies of a function (due to missing dllexport) should be considered alive as soon as one of them is alive.
 

project_rfgs

project_rfgs : set[bauhaus.analysis.config.LayerRelativePath] = set()

Locations of project RFGs of the other project variants that should be considered.
 

Option Types

These types are used by options listed above:

LogLevel

An enumeration.
 
  • WARNING

  • INFO

  • DEBUG