deployphp/deployer

View on GitHub

Showing 201 of 201 total issues

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 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 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 "[$name](/docs/$md#$anchor)";
        Severity: Major
        Found in src/Documentation/DocGen.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return $output;
          Severity: Major
          Found in src/Documentation/DocGen.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return self::compareIdentifiers(
                        $left->getPreRelease(),
                        $right->getPreRelease()
                    );
            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 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 Messenger($c['input'], $c['output'], $c['logger']);
                  Severity: Major
                  Found in src/Deployer.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

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

                      Avoid too many return statements within this method.
                      Open

                                                  return $this->recipes[$r]->tasks[$name];
                      Severity: Major
                      Found in src/Documentation/DocGen.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 $findConfigOverride($this->recipes[$r], $name);
                          Severity: Major
                          Found in src/Documentation/DocGen.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return $x;
                            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 Importer();
                                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 94..103

                                  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

                                  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 79..91

                                  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

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

                                  function parse_home_dir(string $path): string
                                  {
                                      if ('~' === $path || 0 === strpos($path, '~/')) {
                                          if (isset($_SERVER['HOME'])) {
                                              $home = $_SERVER['HOME'];
                                  Severity: Minor
                                  Found in src/Support/helpers.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 execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      protected function execute(Input $input, Output $output): int
                                      {
                                          $this->deployer->input = $input;
                                          $this->deployer->output = $output;
                                  
                                  
                                  Severity: Minor
                                  Found in src/Command/RunCommand.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