6.2.11.1. Common Metric Options

Most metric rules have these options, so they are documented here for brevity.

base_view_name

base_view_name : str = 'Code Facts'

Name of the base view used to calculate/read the metric values.
 

excluded_node_types

excluded_node_types : set[str] = {'Namespace'}

Set of RFG node types for which metrics should not report violations.
 

hierarchy_edge_name

hierarchy_edge_name : str = 'Belongs_To'

Name of the edge used to traverse the hierarchy view.
 

hierarchy_view_name

hierarchy_view_name : str | None = None

Name of the hierarchy view used to propagate the metric values. If None, a view is chosen based on the base_view and the available views in the rfg.
 

macro_library_patterns

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

Globbing patterns for directory/file names for opaque macros in metrics. Requires opaque_macros = True to have an effect. If opaque_macros is set, but no macro_library_patterns are configured, all macro invocations are considered opaque.
 

opaque_macros

opaque_macros : bool = False

Ignore code from macro expansions when computing metrics.
 

propagate

propagate : bool = True

Propagate and aggregate the metric values (leaf values) up through the hierarchy view.
 

report_all_values

report_all_values : bool = False

If enabled, report all metric values, including those that do not violate the configured limits. If disabled, only violations will be reported.
 

report_propagated_values

report_propagated_values : ReportPropagatedMetricValues = 'root'

Report propagated metric values. 'no': Don't report (only store in RFG). 'root': Report value at hierarchy root node. 'all': Report all propagated values.
 

6.2.11.2. Option Types

These types are used by options listed above:

ReportPropagatedMetricValues

An enumeration.
 
  • no

  • root

  • all