Uploaded image for project: 'SonarABAP'
  1. SonarABAP
  2. SONARABAP-412

S2237 FP on compliant code and when test is inverted

    XMLWordPrintable

    Details

    • Type: False-Positive
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.9
    • Component/s: None
    • Labels:
      None

      Description

      We have an FP in the code which is compliant code in the rule description.

      Also if the test for emptiness is in the else clause we raise an issue.

      * As described by the rule.
      IF conn_tab is not initial.
        SELECT carrid , connid , seatsocc FROM flights
        INTO TABLE seatsocc_tab
        FOR ALL ENTRIES IN conn_tab
        WHERE carrid = conn_tab-carrid
        AND connid = conn_tab-connid
      ENDIF.
      
      * Test made the opposite way.
      IF conn_tab2 IS INITIAL.
        * Do Nothing
      ELSE.
        SELECT carrid , connid , seatsocc FROM flights
        INTO TABLE seatsocc_tab
        FOR ALL ENTRIES IN conn_tab2
        WHERE carrid = conn_tab2-carrid
        AND connid = conn_tab2-connid
      ENDIF.
      

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              roberto.orlandi Roberto Orlandi
              Reporter:
              tibor.blenessy Tibor Blenessy
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: