if_in_if - IF in IF

 home edit

Description

Detects nested ifs which can be refactored to a single condition using AND.

Extended Information

https://docs.abapopenchecks.org/checks/01/
https://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#keep-the-nesting-depth-low

Default Configuration

Hover to see descriptions, Ctrl+Space for suggestions

Examples

Bad example:
IF condition1.
  IF condition2.
    ...
  ENDIF.
ENDIF.

Good example:
IF ( condition1 ) AND ( condition2 ).
  ...
ENDIF.