na_0018: Number of nested if/else and case statement

Sub ID Recommendations

  • NA-MAAB — a

  • JMAAB — Not supported

MATLAB Versions

All

Rule

Sub ID a

The number of nested levels in if /else and case statements shall be limited, typically to three levels.

Custom Parameter

Maximum nested levels

Rationale

Sub ID a:

  • Improves readability

  • Code generation may not be possible.

Verification

Model Advisor check: Check MATLAB Function metrics (Simulink Check)

Last Changed

R2020a

Introduced in R2020a