Uploaded image for project: 'Rules Repository'
  1. Rules Repository
  2. RSPEC-1475

"STOP RUN" or "GOBACK" should be the last statement of a sequence

    Details

    • Type: Bug Detection
    • Status: Active
    • Resolution: Unresolved
    • Labels:
    • Message:
      This [STOP RUN|GOBACK] statement should be moved to the end the statement sequence.
    • Default Severity:
      Major
    • Impact:
      Low
    • Likelihood:
      High
    • Default Quality Profiles:
      Sonar way
    • Legacy Key:
      StopRunUsageCheck, COBOL.StopRunUsageCheck
    • Covered Languages:
      Cobol
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      1h

      Description

      Any statement after a STOP RUN or GOBACK is unreachable and therefore dead code which should be removed.

      Noncompliant Code Example

      PARAGRAPH1.  
        MOVE A TO B.         
        STOP RUN. 
        MOVE B TO C.
      

      or

      PARAGRAPH1.  
        MOVE A TO B.         
        GOBACK. 
        MOVE B TO C.
      

      Compliant Solution

      PARAGRAPH1.  
        MOVE A TO B.         
        MOVE B TO C.
        STOP RUN. 
      

      or

      PARAGRAPH1.  
        MOVE A TO B.
        MOVE B TO C.         
        GOBACK. 
      

        Attachments

          Issue Links

          1.
          COBOL RSPEC-5059 Language-Specification Active Unassigned

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                freddy.mallet Freddy Mallet (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: