AutosarC++17_10-A6.4.1¶
A switch statement shall have at least two case-clauses, distinct from the default label
Required inputs: IR
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
empty_switch |
Switch has no “case” clause. |
None |
False |
minimum_switch_cases |
Switch does not have enough code paths. |
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
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
count_default_clause¶
count_default_clause : bool = False
default clause should be counted.
minimum_switch_cases¶
minimum_switch_cases : int = 2
Note: multiple case-labels applied to the same code block are only counted as a single switch clause.