deployphp/deployer

View on GitHub

Showing 189 of 189 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

task('contao:maintenance:disable', function () {
    foreach (array_unique([parse('{{current_path}}'), parse('{{release_or_current_path}}')]) as $path) {
        if (!test("[ -d $path ]")) {
            continue;
        }
Severity: Minor
Found in recipe/contao.php and 1 other location - About 30 mins to fix
recipe/contao.php on lines 80..92

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 90.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Avoid too many return statements within this method.
Open

            return 'bash -ls';
Severity: Major
Found in src/Deployer.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return "$colors[14]$alias\x1b[0m";
    Severity: Major
    Found in src/Support/helpers.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return self::EQUAL_TO;
      Severity: Major
      Found in src/Component/PharUpdate/Version/Comparator.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return new Master(
                        $c['hosts'],
                        $c['input'],
                        $c['output'],
                        $c['messenger'],
        Severity: Major
        Found in src/Deployer.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return !empty($this['log'])
                          ? new FileHandler($this['log'])
                          : new NullHandler();
          Severity: Major
          Found in src/Deployer.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                return "<$tag>$alias</>";
            Severity: Major
            Found in src/Support/helpers.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return new Printer($c['output']);
              Severity: Major
              Found in src/Deployer.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return '-vvv';
                Severity: Major
                Found in src/Ssh/IOArguments.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return new Rsync($c['pop'], $c['output']);
                  Severity: Major
                  Found in src/Deployer.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return self::LESS_THAN;
                    Severity: Major
                    Found in src/Component/PharUpdate/Version/Comparator.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return $y;
                      Severity: Major
                      Found in src/Component/PharUpdate/Version/Comparator.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                    return new HostCollection();
                        Severity: Major
                        Found in src/Deployer.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                      return new ScriptManager($c['tasks']);
                          Severity: Major
                          Found in src/Deployer.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                        return new Selector($c['hosts']);
                            Severity: Major
                            Found in src/Deployer.php - About 30 mins to fix

                              Similar blocks of code found in 2 locations. Consider refactoring.
                              Open

                              task('contao:maintenance:enable', function () {
                                  // Enable maintenance mode in both the current and release build, so that the maintenance mode will be enabled
                                  // for the current installation before the symlink changes and the new installation after the symlink changed.
                                  foreach (array_unique([parse('{{current_path}}'), parse('{{release_or_current_path}}')]) as $path) {
                                      // The current path might not be present during first deploy.
                              Severity: Minor
                              Found in recipe/contao.php and 1 other location - About 30 mins to fix
                              recipe/contao.php on lines 95..104

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 90.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Avoid too many return statements within this method.
                              Open

                                          return new Logger($this['log_handler']);
                              Severity: Major
                              Found in src/Deployer.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                        return false;
                                Severity: Major
                                Found in src/Selector/Selector.php - About 30 mins to fix

                                  Avoid too many return statements within this method.
                                  Open

                                          return "$tag$alias\x1b[0m";
                                  Severity: Major
                                  Found in src/Support/helpers.php - About 30 mins to fix

                                    Avoid too many return statements within this method.
                                    Open

                                                        return new Response(200, $answer);
                                    Severity: Major
                                    Found in src/Executor/Master.php - About 30 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language