TikiWiki/tiki-manager

View on GitHub

Showing 325 of 2,085 total issues

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

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $instances = CommandHelper::getInstances('upgrade');
        $instancesInfo = CommandHelper::getInstancesInfo($instances);
        $tiki_namespace = true;
Severity: Major
Found in src/Command/CloneAndRedactInstanceCommand.php - About 3 hrs to fix

    File Svn.php has 330 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/Svn.php - About 3 hrs to fix

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

          protected function execute(InputInterface $input, OutputInterface $output)
          {
              $helper = $this->getHelper('question');
      
              $instances = CommandHelper::getInstances('all', true);
      Severity: Major
      Found in src/Command/VerifyInstanceCommand.php - About 3 hrs to fix

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

            protected function execute(InputInterface $input, OutputInterface $output)
            {
                $currentCwd = getcwd();
                $instancesOpt = $input->getOption('instances');
                $excludesOpt = $input->getOption('exclude');
        Severity: Minor
        Found in src/Command/StatsInstanceCommand.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

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

            protected function execute(InputInterface $input, OutputInterface $output)
            {
                if (empty($this->instancesInfo)) {
                    $output->writeln('<comment>No instances available to detect.</comment>');
                    return;
        Severity: Minor
        Found in src/Command/DetectInstanceCommand.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

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

            public function applyPatch(Patch $patch, $options)
            {
                $access = $this->instance->getBestAccess('scripting');
                $vcsType = $this->vcs_instance->getIdentifier();
                $can_patch = $access->hasExecutable('patch');
        Severity: Minor
        Found in src/Application/Tiki.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

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

        class Restore extends Backup
        {
            const CLONE_PROCESS = 'clone';
            const RESTORE_PROCESS = 'restore';
        
        
        Severity: Minor
        Found in src/Application/Restore.php - About 3 hrs to fix

          Method setupDatabase has 91 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function setupDatabase(Instance $instance, $reconfigure = false): Instance
              {
                  try {
                      if (!$reconfigure && $this->testExistingDbConnection($instance)) {
                          return $instance;
          Severity: Major
          Found in src/Command/Traits/InstanceConfigure.php - About 3 hrs to fix

            Function readManifest has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
            Open

                public function readManifest($manifestPath)
                {
                    $access = $this->getAccess();
            
                    if ($this->direct && $this->source->type == 'local') {
            Severity: Minor
            Found in src/Application/Restore.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

            Application has 29 functions (exceeds 20 allowed). Consider refactoring.
            Open

            abstract class Application
            {
                protected $instance;
            
                /** @var TikiManagerStyle $io */
            Severity: Minor
            Found in src/Application/Application.php - About 3 hrs to fix

              Method restore has 87 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function restore($srcInstance, $archive, $clone = false, $checksumCheck = false, $direct = false, $onlyData = false, $onlyCode = false, $options = [])
                  {
                      $restore = new Restore($this, $direct, $onlyData);
                      $restore->lock();
                      $restore->setProcess($clone);
              Severity: Major
              Found in src/Application/Instance.php - About 3 hrs to fix

                Function getSVNPath has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getSVNPath()
                    {
                        $host = $this->getHost();
                
                        if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
                Severity: Minor
                Found in src/Access/Local.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

                File Database.php has 307 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/Libs/Database/Database.php - About 3 hrs to fix

                  Function restore has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function restore($srcInstance, $archive, $clone = false, $checksumCheck = false, $direct = false, $onlyData = false, $onlyCode = false, $options = [])
                      {
                          $restore = new Restore($this, $direct, $onlyData);
                          $restore->lock();
                          $restore->setProcess($clone);
                  Severity: Minor
                  Found in src/Application/Instance.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

                  Function copyDirectories has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function copyDirectories($targets, $backupDir)
                      {
                          $access = $this->getAccess();
                          $backupDir = $backupDir ?: $this->backupDir;
                          $result = [];
                  Severity: Minor
                  Found in src/Application/Backup.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

                  Function getAvailableBranches has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getAvailableBranches()
                      {
                          $versions = [];
                  
                          foreach (explode("\n", `git ls-remote --heads --tags --refs $this->repositoryUrl`) as $line) {
                  Severity: Minor
                  Found in src/Libs/VersionControl/Git.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

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

                      protected function execute(InputInterface $input, OutputInterface $output)
                      {
                          $checksumCheck = $input->getOption('check') ?? false;
                          $instancesOption = $input->getOption('instances');
                          $instances = CommandHelper::getInstances('update');
                  Severity: Major
                  Found in src/Command/UpgradeInstanceCommand.php - About 3 hrs to fix

                    SSH has 27 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class SSH extends Access implements ShellPrompt
                    {
                        private $location;
                        private $env = [];
                        private $changeLocation = null;
                    Severity: Minor
                    Found in src/Access/SSH.php - About 3 hrs to fix

                      Local has 27 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Local extends Access implements ShellPrompt
                      {
                          private $location;
                          private $env = [];
                          private $hostlib = null;
                      Severity: Minor
                      Found in src/Access/Local.php - About 3 hrs to fix

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

                            protected function configure()
                            {
                                parent::configure();
                        
                                $this
                        Severity: Major
                        Found in src/Command/SetupCloneManagerCommand.php - About 3 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language