Having two branches in the same if
structure with the same implementation is at best duplicate code,
and at worst a coding error. If the same logic is truly needed for both instances, then they should be combined.
IF var BETWEEN 0 AND 10 THEN do_the_thing(); ELSIF var BETWEEN 10 AND 20 THEN do_the_thing(); -- Noncompliant; duplicates first condition ELSIF var BETWEEN 20 AND 50 THEN do_the_another_thing(); ELSE do_the_rest() END IF;
IF (var BETWEEN 0 AND 20) THEN do_the_thing(); ELSIF var BETWEEN 10 AND 20 THEN do_the_another_thing(); ELSE do_the_rest() END IF;
or
IF var BETWEEN 0 AND 10 THEN do_the_thing(); ELSIF var BETWEEN 10 AND 20 THEN do_the_second_thing(); ELSIF var BETWEEN 20 AND 50 THEN do_the_another_thing(); ELSE do_the_rest() END IF;