TikiWiki/tiki-manager

View on GitHub

Showing 325 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

      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

                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

                        Method configure has 149 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function configure()
                            {
                                parent::configure();
                        
                                $this
                        Severity: Major
                        Found in src/Command/CreateInstanceCommand.php - About 5 hrs to fix

                          File Backup.php has 414 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: Minor
                          Found in src/Application/Backup.php - About 5 hrs to fix

                            File CommandHelper.php has 403 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/Command/Helper/CommandHelper.php - About 5 hrs to fix

                              Function _mysqldump_table_data has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function _mysqldump_table_data($table)
                              {
                                  $sql = "select COUNT(*) from `$table`;";
                                  $result = query($sql);
                                  $num_rows = fetch_row($result);
                              Severity: Minor
                              Found in scripts/tiki/mysqldump.php - About 5 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

                              Severity
                              Category
                              Status
                              Source
                              Language