hnhdigital-os/mysql-helper

View on GitHub

Showing 29 of 103 total issues

Avoid too many return statements within this method.
Open

                    return 1;
Severity: Major
Found in app/Commands/CloneCommand.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return $this->cloneLocalDatabases($profile, $local_connection, $source_database, $destination_database);
    Severity: Major
    Found in app/Commands/CloneCommand.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                          return 1;
      Severity: Major
      Found in app/Commands/CloneCommand.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                            return 1;
        Severity: Major
        Found in app/Commands/CloneCommand.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return $this->updateRemoteProfileName($profile, $name, $option);
          Severity: Major
          Found in app/Commands/ConfigureCommand.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return 1;
            Severity: Major
            Found in app/Commands/CloneCommand.php - About 30 mins to fix

              Function updateRemoteProfile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function updateRemoteProfile($profile, $name)
                  {
                      $data = array_get($this->profiles, $profile.'.remote.'.$name, []);
              
                      $public_key = array_get($data, 'public_key', $this->getUserHome('.ssh/id_rsa.pub'));
              Severity: Minor
              Found in app/Commands/ConfigureCommand.php - About 25 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function selectLocalDatabase has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function selectLocalDatabase($profile, $connection, $type)
                  {
                      switch ($type) {
                          case self::DATABASE_TYPE_DESTINATION:
                              $title = 'Select destination database';
              Severity: Minor
              Found in app/Commands/CloneCommand.php - About 25 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function listDatabases has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function listDatabases()
                  {
                      // Select profile.
                      if (empty($profile = $this->option('profile'))) {
                          $profile = $this->selectProfile();
              Severity: Minor
              Found in app/Commands/DisplayCommand.php - About 25 mins to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Severity
              Category
              Status
              Source
              Language