TikiWiki/tiki-manager

View on GitHub

Showing 2,080 of 2,080 total issues

File Tiki.php has 1069 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
// Copyright (c) 2016, Avan.Tech, et. al.
// Copyright (c) 2008, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
Severity: Major
Found in src/Application/Tiki.php - About 2 days to fix

    File Instance.php has 901 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * @copyright (c) Copyright by authors of the Tiki Manager Project. All Rights Reserved.
     *     See copyright.txt for details and a complete list of authors.
     * @copyright (c) 2016, Avan.Tech, et. al.
    Severity: Major
    Found in src/Application/Instance.php - About 2 days to fix

      Function execute has a Cognitive Complexity of 96 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function execute(InputInterface $input, OutputInterface $output)
          {
              $instances = CommandHelper::getInstances('all', true);
              $instancesInfo = CommandHelper::getInstancesInfo($instances);
      
      
      Severity: Minor
      Found in src/Command/CloneInstanceCommand.php - About 1 day 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

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

              $this
                  ->setName('instance:cloneandupgrade')
                  ->setDescription('Clone and upgrade instance')
                  ->setHelp('This command allows you make another identical copy of Tiki with an extra upgrade operation')
                  ->addArgument('mode', InputArgument::IS_ARRAY | InputArgument::OPTIONAL)
      Severity: Major
      Found in src/Command/CloneAndUpgradeInstanceCommand.php and 1 other location - About 1 day to fix
      src/Command/CloneInstanceCommand.php on lines 36..142

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

      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

              $this
                  ->setName('instance:clone')
                  ->setDescription('Clone instance')
                  ->setHelp('This command allows you make another identical copy of Tiki')
                  ->addArgument('mode', InputArgument::IS_ARRAY | InputArgument::OPTIONAL)
      Severity: Major
      Found in src/Command/CloneInstanceCommand.php and 1 other location - About 1 day to fix
      src/Command/CloneAndUpgradeInstanceCommand.php on lines 23..129

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

      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 274 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function execute(InputInterface $input, OutputInterface $output)
          {
              $instances = CommandHelper::getInstances('all', true);
              $instancesInfo = CommandHelper::getInstancesInfo($instances);
      
      
      Severity: Major
      Found in src/Command/CloneInstanceCommand.php - About 1 day to fix

        Function handleCheckResult has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function handleCheckResult(Instance $instance, Version $version, $array)
            {
                if (! $_ENV['INTERACTIVE']) {
                    return; // skip
                }
        Severity: Minor
        Found in src/Libs/Helpers/Checksum.php - About 1 day 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

        Instance has 62 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Instance
        {
            const TYPES = 'local,ftp,ssh';
        
            const SQL_SELECT_INSTANCE = <<<SQL
        Severity: Major
        Found in src/Application/Instance.php - About 1 day to fix

          File Restore.php has 533 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          // Copyright (c) 2016, Avan.Tech, et. al.
          // Copyright (c) 2008, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
          // All Rights Reserved. See copyright.txt for details and a complete list of authors.
          // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
          Severity: Major
          Found in src/Application/Restore.php - About 1 day to fix

            Method runSetup has 218 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function runSetup()
                {
                    debug('Running Tiki Manager at ' . $_ENV['TRIM_ROOT']);
            
                    $writableFolders = ['CACHE_FOLDER', 'TEMP_FOLDER', 'RSYNC_FOLDER', 'MOUNT_FOLDER', 'BACKUP_FOLDER', 'ARCHIVE_FOLDER', 'TRIM_LOGS', 'TRIM_DATA', 'TRIM_SRC_FOLDER'];
            Severity: Major
            Found in src/Config/Environment.php - About 1 day to fix

              Function execute has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function execute(InputInterface $input, OutputInterface $output)
                  {
                      $instances = CommandHelper::getInstances('update');
                      $instancesInfo = CommandHelper::getInstancesInfo($instances);
              
              
              Severity: Minor
              Found in src/Command/UpdateInstanceCommand.php - About 1 day 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

              Tiki has 58 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Tiki extends Application
              {
                  private $installType = null;
                  private $branch = null;
                  private $installed = null;
              Severity: Major
              Found in src/Application/Tiki.php - About 1 day to fix

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

                <?php
                
                namespace TikiManager\Command;
                
                use Symfony\Component\Console\Input\InputInterface;
                Severity: Major
                Found in src/Command/ClearLogsCommand.php and 1 other location - About 7 hrs to fix
                src/Command/DeleteDatabaseCommand.php on lines 1..48

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

                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

                <?php
                
                namespace TikiManager\Command;
                
                use Symfony\Component\Console\Input\InputInterface;
                Severity: Major
                Found in src/Command/DeleteDatabaseCommand.php and 1 other location - About 7 hrs to fix
                src/Command/ClearLogsCommand.php on lines 1..47

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

                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 execute has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function execute(InputInterface $input, OutputInterface $output)
                    {
                        $helper = $this->getHelper('question');
                
                        $instances = CommandHelper::getInstances('all', true);
                Severity: Minor
                Found in src/Command/VerifyInstanceCommand.php - About 7 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

                File InstanceConfigure.php has 492 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                namespace TikiManager\Command\Traits;
                
                use Psr\Log\LoggerAwareTrait;
                Severity: Minor
                Found in src/Command/Traits/InstanceConfigure.php - About 7 hrs to fix

                  Method handleCheckResult has 194 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function handleCheckResult(Instance $instance, Version $version, $array)
                      {
                          if (! $_ENV['INTERACTIVE']) {
                              return; // skip
                          }
                  Severity: Major
                  Found in src/Libs/Helpers/Checksum.php - About 7 hrs to fix

                    Function execute has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function execute(InputInterface $input, OutputInterface $output)
                        {
                            $instances = CommandHelper::getInstances();
                            $instancesInfo = CommandHelper::getInstancesInfo($instances);
                    
                    
                    Severity: Minor
                    Found in src/Command/EditInstanceCommand.php - About 7 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

                    File CloneInstanceCommand.php has 438 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    /**
                     * @copyright (c) Copyright by authors of the Tiki Manager Project. All Rights Reserved.
                     *     See copyright.txt for details and a complete list of authors.
                    Severity: Minor
                    Found in src/Command/CloneInstanceCommand.php - About 6 hrs to fix

                      File Git.php has 418 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      /**
                       * @copyright (c) Copyright by authors of the Tiki Manager Project. All Rights Reserved.
                       *     See copyright.txt for details and a complete list of authors.
                       * @licence Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See LICENSE for details.
                      Severity: Minor
                      Found in src/Libs/VersionControl/Git.php - About 6 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language