TikiWiki/tiki-manager

View on GitHub

Showing 2,085 of 2,085 total issues

Git has 35 functions (exceeds 20 allowed). Consider refactoring.
Open

class Git extends VersionControlSystem
{
    protected const DEFAULT_GIT_REPOSITORY = 'https://gitlab.com/tikiwiki/tiki.git';
    protected $isDefultRepository = false;

Severity: Minor
Found in src/Libs/VersionControl/Git.php - About 4 hrs to fix

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

        public function copyFile($remoteSource, $remoteTarget)
        {
            if ($remoteSource[0] != '/' && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
                $remoteSource = $this->instance->getWebPath($remoteSource);
            }
    Severity: Major
    Found in src/Access/SSH.php and 1 other location - About 4 hrs to fix
    src/Access/SSH.php on lines 310..323

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

    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

        public function moveFile($remoteSource, $remoteTarget)
        {
            if ($remoteSource[0] != '/' && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
                $remoteSource = $this->instance->getWebPath($remoteSource);
            }
    Severity: Major
    Found in src/Access/SSH.php and 1 other location - About 4 hrs to fix
    src/Access/SSH.php on lines 325..338

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

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

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

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

              while (! empty($stack)) {
                  $stack_item = array_pop($stack);
                  $curNode = $stack_item[0];
                  $output = &$stack_item[1];
      
      
      Severity: Major
      Found in src/Libs/VersionControl/Svn.php and 1 other location - About 4 hrs to fix
      src/Repository/SVN.php on lines 221..241

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

      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

                  while (!empty($stack)) {
                      $stack_item = array_pop($stack);
                      $cur_node = $stack_item[0];
                      $output = &$stack_item[1];
      
      
      Severity: Major
      Found in src/Repository/SVN.php and 1 other location - About 4 hrs to fix
      src/Libs/VersionControl/Svn.php on lines 213..233

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

      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 runSetup has a Cognitive Complexity of 29 (exceeds 5 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: Minor
      Found in src/Config/Environment.php - About 4 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 104 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function execute(InputInterface $input, OutputInterface $output)
          {
              $currentCwd = getcwd();
              $instancesOpt = $input->getOption('instances');
              $excludesOpt = $input->getOption('exclude');
      Severity: Major
      Found in src/Command/StatsInstanceCommand.php - About 4 hrs to fix

        File SSH.php has 338 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/Access/SSH.php - About 4 hrs to fix

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

              protected function execute(InputInterface $input, OutputInterface $output)
              {
                  // select time handle
                  $time = $input->getOption('time');
                  CommandHelper::validateCrontabInput($time);
          Severity: Minor
          Found in src/Command/SetupCloneManagerCommand.php - About 4 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 configure has 102 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

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

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

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

                      if (empty($input->getOption('instances'))) {
                          CommandHelper::renderInstancesTable($output, $instancesInfo);
                          $this->io->newLine();
                          $output->writeln('<comment>Note: Only Tiki instances can have patches applied</comment>');
                          $this->io->newLine();
              Severity: Major
              Found in src/Command/ApplyPatchCommand.php and 2 other locations - About 3 hrs to fix
              src/Command/ApplyProfileCommand.php on lines 53..67
              src/Command/ListPatchCommand.php on lines 40..54

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

              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

                      if (empty($input->getOption('instances'))) {
                          CommandHelper::renderInstancesTable($output, $instancesInfo);
                          $this->io->newLine();
                          $output->writeln('<comment>Note: Only Tiki instances can have profiles applied</comment>');
                          $this->io->newLine();
              Severity: Major
              Found in src/Command/ApplyProfileCommand.php and 2 other locations - About 3 hrs to fix
              src/Command/ApplyPatchCommand.php on lines 71..85
              src/Command/ListPatchCommand.php on lines 40..54

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

              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

                      if (empty($input->getOption('instances'))) {
                          CommandHelper::renderInstancesTable($output, $instancesInfo);
                          $this->io->newLine();
                          $output->writeln('<comment>Note: Only Tiki instances can have patches applied</comment>');
                          $this->io->newLine();
              Severity: Major
              Found in src/Command/ListPatchCommand.php and 2 other locations - About 3 hrs to fix
              src/Command/ApplyPatchCommand.php on lines 71..85
              src/Command/ApplyProfileCommand.php on lines 53..67

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

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

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

                            if (isset($instancesInfo) && empty($input->getOption('exclude'))) {
                                CommandHelper::renderInstancesTable($output, $instancesInfo);
                                $this->io->newLine();
                                $this->io->writeln('<comment>In case you want to ignore more than one instance, please use a comma (,) between the values</comment>');
                    
                    
                    Severity: Major
                    Found in src/Command/SetupBackupManagerCommand.php and 2 other locations - About 3 hrs to fix
                    src/Command/SetupWatchManagerCommand.php on lines 73..88
                    src/Command/WatchInstanceCommand.php on lines 62..77

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

                    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

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

                            if (isset($instancesInfo) && empty($input->getOption('exclude'))) {
                                CommandHelper::renderInstancesTable($output, $instancesInfo);
                                $this->io->newLine();
                                $this->io->writeln('<comment>In case you want to ignore more than one instance, please use a comma (,) between the values</comment>');
                    
                    
                    Severity: Major
                    Found in src/Command/WatchInstanceCommand.php and 2 other locations - About 3 hrs to fix
                    src/Command/SetupBackupManagerCommand.php on lines 67..84
                    src/Command/SetupWatchManagerCommand.php on lines 73..88

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

                    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