6.2.2. Common Options

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

6.2.2.1. confidence

confidence : AnalysisConfidence | None = None

How certain this check is that the violations it reports really are violations.

This is reported with every violation, and mirrored into the rank factor column of every risk ranking entry created from /Analysis/RiskRanking-AnalysisConfidence, by default the Confidence column. If unset, no confidence is reported, and a rule that consists of several parts reports the confidence stated by the part a violation comes from. Individual messages of the check may override this via their own confidence.

 

6.2.2.2. exclude_in_macros

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

Macro name patterns for macros where this rule should not be applied. Violations will not be reported if they are from code generated by the expansion of a macro matching one of these glob patterns.
 

6.2.2.3. exclude_messages_in_system_headers

exclude_messages_in_system_headers : bool | None = None

Whether to exclude files marked as system headers.

If this option is not set, the option defaults to true, except when axivion_analysis is called with the --system_headers command-line argument. In axivion_ci, this option always defaults to true.

If this option is set, the axivion_analysis --system_headers command-line argument will have no effect.

System headers are the header files that are found in the system include path. #pragma GCC system_header also causes files to be classified as system header.

 

6.2.2.4. excludes

excludes : set[bauhaus.analysis.config.FileGlobPattern] = set()

Filename patterns for files to exclude from the individual rule.

Note that excludes can also be specified via the option /Analysis/global_excludes or via the `axivion_analysis --exclude` command-line option.

If both includes and excludes are used, the rule applies to all files that match at least one include pattern, and do not match any exclude patterns.

 

6.2.2.5. extend_exclude_to_macro_invocations

extend_exclude_to_macro_invocations : bool = False

When true, messages associated with macro expansions will not be reported if the macro is defined in an excluded file. This applies even if the violation is depending on the context in which the macro is used.

Note: violations reported inside the macro definition itself (e.g. if report_at is set to automatic) are always excluded, independently of this option.

 

6.2.2.6. includes

includes : set[bauhaus.analysis.config.FileGlobPattern] = set()

Filename patterns to restrict this individual rule to. May be combined with the /Analysis/global_includes (the rule then is applied to more locations than just the global include patterns).

If both includes and excludes are used, the rule applies to all files that match at least one include pattern, and do not match any exclude patterns.

 

6.2.2.7. justification_checker

justification_checker

Type: typing.Callable[[typing.Union[analysis_result_pb2.Architecture_Violation, analysis_result_pb2.Clone_Pair, analysis_result_pb2.Cycle_Finding, analysis_result_pb2.Dead_Entity, analysis_result_pb2.Metric, analysis_result_pb2.Style_Violation]], NoneType] | None

Default: None

Can be set to a callable taking (and possibly modifying) a style violation instance. Will be called per issue and can be used to check a disabled issue's justification, for example, against permitted ones.

Note: use the post_processing option for a more general method of filtering/modifying violations produced by this rule.

 

6.2.2.8. languages

languages : set[Language] = {'Assembler', 'C#', 'C', 'C++', 'C++/CLI'}

Source languages the rule applies to. Violations are excluded if they appear in a file of a language not in this set.
 

6.2.2.9. post_processing

post_processing : bauhaus.analysis.post_processing.PostProcessingSettings = <PostProcessingSettings(0 filters)>

This option allows registering custom post-processing steps that will be applied to violations produced by this rule.

See the documentation of module axivion.analysis.post_processing for more information.

 

6.2.2.10. provider

provider : str = 'axivion'

Provider of this check, appears in the dashboard.
 

6.2.2.11. report_at

report_at : MacroViolationPosition = 'automatic'

Select where violations from macro expansions should be reported.

Note: Reporting violations at the macro definition will cause violations to be excluded if the macro is defined in an excluded file (e.g. system header).

 

6.2.2.12. severity

severity : str = 'error'

Severity to classify violations, appears in the dashboard.
 

6.2.3. Option Types

These types are used by options listed above:

6.2.3.1. AnalysisConfidence

How certain the analysis is that a finding really is what its message claims.

This describes the analysis, not the finding: how bad a finding is, is expressed by its severity. It is also unrelated to the likelihood stated by coding standards such as CERT, which is about how likely the reported code is to be exploitable.

 

definite

The analysis proves the finding; no approximation is involved.

probable

The finding rests on an approximation the analysis made, but is considered likely nevertheless. For the semantic checks, this means it survived the heuristics that filter out unlikely over-approximations.

improbable

The analysis over-approximates and considers the finding unlikely, but reports it anyway.

6.2.3.2. Language

IR languages, used for language filter.
 

C

C code.

C++

C++ code.

C#

C# code.

C++/CLI

C++/CLI code.

Assembler

Assembler code.

Rust

Rust code.

6.2.3.3. MacroViolationPosition

Where to report a violation that stems from a macro expansion.
 

automatic

Automatically determine whether to report a violation at the macro invocation or definition. By the default this will report at the macro invocation, but some rules have special logic to report the violation in macro definitions when appropriate (usually when the violation is independent of the macro arguments).

macro_invocation

Always report violations at macro invocation.

macro_definition

Always report violations at the macro definition, even if the violation might depend on macro arguments.