deployphp/deployer

View on GitHub

Showing 201 of 201 total issues

File magento2.php has 371 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
namespace Deployer;

require_once __DIR__ . '/common.php';
require_once __DIR__ . '/../contrib/cachetool.php';
Severity: Minor
Found in recipe/magento2.php - About 4 hrs to fix

    Method parse has 121 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function parse(string $content)
        {
            $comment = '';
            $desc = '';
            $currentTask = null;
    Severity: Major
    Found in src/Documentation/DocRecipe.php - About 4 hrs to fix

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

      task('cimonitor:notify', function () {
          if (!get('cimonitor_webhook', false)) {
              return;
          }
      
      
      Severity: Major
      Found in contrib/cimonitor.php and 1 other location - About 4 hrs to fix
      contrib/cimonitor.php on lines 142..165

      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 177.

      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('cimonitor:notify:failure', function () {
          if (!get('cimonitor_webhook', false)) {
              return;
          }
      
      
      Severity: Major
      Found in contrib/cimonitor.php and 1 other location - About 4 hrs to fix
      contrib/cimonitor.php on lines 88..111

      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 177.

      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

      File DocGen.php has 351 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php declare(strict_types=1);
      
      /* (c) Anton Medvedev <anton@medv.io>
       *
       * For the full copyright and license information, please view the LICENSE
      Severity: Minor
      Found in src/Documentation/DocGen.php - About 4 hrs to fix

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

        task('slack:notify', function () {
            if (!get('slack_webhook', false)) {
                warning('No Slack webhook configured');
                return;
            }
        Severity: Major
        Found in contrib/slack.php and 2 other locations - About 4 hrs to fix
        contrib/slack.php on lines 140..157
        contrib/slack.php on lines 160..177

        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 169.

        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 3 locations. Consider refactoring.
        Open

        task('slack:notify:failure', function () {
            if (!get('slack_webhook', false)) {
                warning('No Slack webhook configured');
                return;
            }
        Severity: Major
        Found in contrib/slack.php and 2 other locations - About 4 hrs to fix
        contrib/slack.php on lines 99..116
        contrib/slack.php on lines 160..177

        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 169.

        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 3 locations. Consider refactoring.
        Open

        task('slack:notify:rollback', function () {
            if (!get('slack_webhook', false)) {
                warning('No Slack webhook configured');
                return;
            }
        Severity: Major
        Found in contrib/slack.php and 2 other locations - About 4 hrs to fix
        contrib/slack.php on lines 99..116
        contrib/slack.php on lines 140..157

        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 169.

        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

        Method execute has 100 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function execute(InputInterface $input, OutputInterface $output): int
            {
                if (getenv('COLORTERM') === 'truecolor') {
                    $output->write(<<<EOF
        ╭───────────────────────────────────────╮
        Severity: Major
        Found in src/Command/InitCommand.php - About 4 hrs to fix

          File BlackjackCommand.php has 333 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php declare(strict_types=1);
          
          /* (c) Anton Medvedev <anton@medv.io>
           *
           * For the full copyright and license information, please view the LICENSE
          Severity: Minor
          Found in src/Command/BlackjackCommand.php - About 4 hrs to fix

            Method call has 96 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function call(Host $host, $source, string $destination, array $config = []): void
                {
                    $defaults = [
                        'timeout' => null,
                        'options' => [],
            Severity: Major
            Found in src/Utility/Rsync.php - About 3 hrs to fix

              Method tasks has 95 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected static function tasks(array $tasks)
                  {
                      $buildTask = function ($name, $steps) {
                          $body = function () {
                          };
              Severity: Major
              Found in src/Importer/Importer.php - About 3 hrs to fix

                Function import has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function import($paths)
                    {
                        if (!is_array($paths)) {
                            $paths = [$paths];
                        }
                Severity: Minor
                Found in src/Importer/Importer.php - About 3 hrs 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

                Task has 30 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class Task
                {
                    /**
                     * @var string
                     */
                Severity: Minor
                Found in src/Task/Task.php - About 3 hrs to fix

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

                  task('mattermost:notify', function() {
                      if (null === get('mattermost_webhook')) {
                          return;
                      }
                  
                  
                  Severity: Major
                  Found in contrib/mattermost.php and 2 other locations - About 3 hrs to fix
                  contrib/mattermost.php on lines 114..132
                  contrib/mattermost.php on lines 135..153

                  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 155.

                  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 3 locations. Consider refactoring.
                  Open

                  task('mattermost:notify:success', function() {
                      if (null === get('mattermost_webhook')) {
                          return;
                      }
                  
                  
                  Severity: Major
                  Found in contrib/mattermost.php and 2 other locations - About 3 hrs to fix
                  contrib/mattermost.php on lines 93..111
                  contrib/mattermost.php on lines 135..153

                  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 155.

                  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 3 locations. Consider refactoring.
                  Open

                  task('mattermost:notify:failure', function() {
                      if (null === get('mattermost_webhook')) {
                          return;
                      }
                  
                  
                  Severity: Major
                  Found in contrib/mattermost.php and 2 other locations - About 3 hrs to fix
                  contrib/mattermost.php on lines 93..111
                  contrib/mattermost.php on lines 114..132

                  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 155.

                  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 3 locations. Consider refactoring.
                  Open

                  task('ntfy:notify:failure', function () {
                      if (!get('ntfy_topic', false)) {
                          warning('No ntfy topic configured');
                          return;
                      }
                  Severity: Major
                  Found in contrib/ntfy.php and 2 other locations - About 3 hrs to fix
                  contrib/ntfy.php on lines 107..122
                  contrib/ntfy.php on lines 125..140

                  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 151.

                  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 3 locations. Consider refactoring.
                  Open

                  task('ntfy:notify:success', function () {
                      if (!get('ntfy_topic', false)) {
                          warning('No ntfy topic configured');
                          return;
                      }
                  Severity: Major
                  Found in contrib/ntfy.php and 2 other locations - About 3 hrs to fix
                  contrib/ntfy.php on lines 107..122
                  contrib/ntfy.php on lines 143..158

                  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 151.

                  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 3 locations. Consider refactoring.
                  Open

                  task('ntfy:notify', function () {
                      if (!get('ntfy_topic', false)) {
                          warning('No ntfy topic configured');
                          return;
                      }
                  Severity: Major
                  Found in contrib/ntfy.php and 2 other locations - About 3 hrs to fix
                  contrib/ntfy.php on lines 125..140
                  contrib/ntfy.php on lines 143..158

                  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 151.

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language