Uploaded image for project: 'VCL'
  1. VCL
  2. VCL-887

Clean up backend code

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Done
    • None
    • 2.5
    • vcld (backend)
    • None

    Description

      Nearly all of the backend code is consistently formatted. For example:

      if ($foo) {
         notify($ERRORS{'OK'}, 0, "some useful message");
      }
      else {
         notify($ERRORS{'WARNING'}, 0, "some useful warning");
      }
      

      There is a space between if and the opening parenthesis and another between the closing parenthesis and opening curly bracket. Compare it to:

      if(!defined($du_output)) {
         notify($ERRORS{'WARNING'}, 0, "failed to execute command du command to if image $image_name exists");
         return;
      }
      

      Where's the space? What does the message mean?

      Granted, the space issues are trivial. The nonsensical notify message is a bit more of a problem.

      Perhaps we should create a script to analyze the code or even add a hidden option to vcld to analyze itself. Committers could run it before committing to check for any accidental inconsistencies. We could add a step to the release procedures to run the script and check for inconsistencies.

      This issue will be used to track all of the code cleanup and of the development of any automated methods created to address this.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            arkurth Andrew Kurth
            arkurth Andrew Kurth
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment