Miscellaneous-MaxConditions¶
An expression must not have more than N logical operators
Required inputs: IR
&& or ||) are used within a single expression.
As an exception, this rule does not warn about complex conditions within
custom operator == or operator != definitions.
Those operators are often implemented by compare all the class members in a long chain of logical operators.
Rationale
Complex conditions can be hard to understand, and should be split into several statements or extracted into a function.Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
excessive_condition_complexity |
An expression must not have more than {} logical operators. |
None |
False |
Options¶
This rule shares the following common options: exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
This rule shares the following common metric options: macro_library_patterns, opaque_macros
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
ignore_in¶
ignore_in : set[bauhaus.analysis.config.FunctionName] = {'operator!=', 'operator=='}
maxconditions¶
maxconditions : int = 7