Uploaded image for project: 'SonarCOBOL'
  1. SonarCOBOL
  2. SONARCOBOL-1267

False Positive AlwaysTrueOrFalseConditionCheck (S2583): data item is updated by a SQL statement

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.8
    • Fix Version/s: 3.0
    • Component/s: Rules
    • Labels:
      None

      Description

      Rule "Conditions should not unconditionally evaluate to TRUE or to FALSE" (RSPEC-2583) should not raise an issue for the following code:

             ID DIVISION.
             DATA DIVISION.
             WORKING-STORAGE SECTION.
               01 X PIC 99.
             PROCEDURE DIVISION.
               IF X = 0
               
                 EXEC SQL
                   select 1 into :X from dual
                 END-EXEC
      
                 IF X = 0               
                   DISPLAY X
                 END-IF
                   
               END-IF.
      

        Attachments

          Activity

            People

            • Assignee:
              elena.vilchik Elena Vilchik
              Reporter:
              pierre-yves.nicolas Pierre-Yves Nicolas
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: