TikiWiki/tiki-manager

View on GitHub

Showing 2,255 of 2,255 total issues

Method detectPHPLinux has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function detectPHPLinux($options = [], $searchOrder = null)
    {
        if ($searchOrder === null) {
            $searchOrder = [
                ['command', ['-v', 'php']],
Severity: Minor
Found in src/Application/Discovery/LinuxDiscovery.php - About 1 hr to fix

    Method info has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function info($targetFolder, $raw = false)
        {
            $cmd = "info $targetFolder";
            if (! $raw) {
                $cmd .= ' --xml';
    Severity: Minor
    Found in src/Libs/VersionControl/Svn.php - About 1 hr to fix

      Method info has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function info($path, $args = [])
          {
              if (empty($args)) {
                  $args = $this->getDefaultArgs('info');
              }
      Severity: Minor
      Found in src/Repository/SVN.php - About 1 hr to fix

        Method createArchive has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function createArchive($archiveDir = null)
            {
                $archiveDir = $archiveDir ?: $this->archiveDir;
        
                $bzipStep = false;
        Severity: Minor
        Found in src/Application/Backup.php - About 1 hr to fix

          Method detectPHPMacOS has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function detectPHPMacOS($options = [], $searchOrder = null)
              {
                  if ($searchOrder === null) {
                      $searchOrder = [
                          ['command', ['-v', 'php']],
          Severity: Minor
          Found in src/Application/Discovery/MacOSDiscovery.php - About 1 hr to fix

            Method update has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function update(string $targetFolder, string $branch, int $lag = 0)
                {
                    $info = $this->info($targetFolder);
                    $root = $info['repository']['root'];
                    $url = $info['url'];
            Severity: Minor
            Found in src/Libs/VersionControl/Svn.php - About 1 hr to fix

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

                  protected function execute(InputInterface $input, OutputInterface $output)
                  {
                      $instances = CommandHelper::getInstances('tiki');
                      $instancesInfo = CommandHelper::getInstancesInfo($instances);
              
              
              Severity: Minor
              Found in src/Command/ListPatchCommand.php - About 1 hr to fix

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

                    protected function execute(InputInterface $input, OutputInterface $output)
                    {
                        if (empty($this->instancesInfo)) {
                            $this->io->info('No instances available');
                            return Command::SUCCESS;
                Severity: Minor
                Found in src/Command/TagAddOrEditCommand.php - About 1 hr to fix

                  Method setInstanceSetupError has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function setInstanceSetupError($instanceId, \Exception $e = null, $action = 'install')
                      {
                          $errors = [];
                          $io = App::get('io');
                  
                  
                  Severity: Minor
                  Found in src/Command/Helper/CommandHelper.php - About 1 hr to fix

                    Method getAvailableBranches has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getAvailableBranches()
                        {
                            $versions = [];
                            $versionsTemp = [];
                    
                    
                    Severity: Minor
                    Found in src/Libs/VersionControl/Svn.php - About 1 hr to fix

                      Method rsync has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function rsync($args = [])
                          {
                              $return_val = -1;
                      
                              if (empty($args['src']) || empty($args['dest'])) {
                      Severity: Minor
                      Found in src/Libs/Host/Local.php - About 1 hr to fix

                        Method getAvailableBranches has 32 lines of code (exceeds 25 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 1 hr to fix

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

                              protected function execute(InputInterface $input, OutputInterface $output)
                              {
                                  $instances = CommandHelper::getInstances();
                                  $instancesInfo = CommandHelper::getInstancesInfo($instances);
                                  if (isset($instancesInfo)) {
                          Severity: Minor
                          Found in src/Command/AccessInstanceCommand.php - About 1 hr 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 loadEnvironmentVariablesContainingLogic has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private function loadEnvironmentVariablesContainingLogic()
                              {
                                  $_ENV['TRIM_OS'] = strtoupper(substr(PHP_OS, 0, 3));
                          
                                  if ($_ENV['TRIM_OS'] === 'WIN') {
                          Severity: Minor
                          Found in src/Config/Environment.php - About 1 hr 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 restore has 10 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public function restore($srcInstance, $archive, $clone = false, $checksumCheck = false, $direct = false, $onlyData = false, $onlyCode = false, $options = [], $skipSystemConfigurationCheck = false, $allowCommonParents = 0)
                          Severity: Major
                          Found in src/Application/Instance.php - About 1 hr to fix

                            Function getHost has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function getHost()
                                {
                                    $host = new SSHHost($this->host, $this->user, $this->port);
                            
                                    // change cwd before executing commands, for instance in CoreOS it may influence what
                            Severity: Minor
                            Found in src/Access/SSH.php - About 1 hr 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 getInterpreterPath has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function getInterpreterPath(TikiRequirements $requirements = null)
                                {
                                    $instance = $this->instance;
                                    $detectedBinaries = $instance->phpexec ? [$instance->phpexec] : $instance->getDiscovery()->detectPHP();
                            
                            
                            Severity: Minor
                            Found in src/Access/SSH.php - About 1 hr 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 create has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function create($skipArchive = false, $backupDir = null)
                                {
                                    $backupDir = $backupDir ?: $this->backupDir;
                            
                                    $this->io->writeln('Checking directories...');
                            Severity: Minor
                            Found in src/Application/Backup.php - About 1 hr 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 rsync has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function rsync($args = [])
                                {
                                    $return_val = -1;
                                    if (empty($args['src']) || empty($args['dest'])) {
                                        return $return_val;
                            Severity: Minor
                            Found in src/Libs/Host/SSH.php - About 1 hr 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 getBranchToUpdate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function getBranchToUpdate($branch)
                                {
                                    if (preg_match('/(\d+)\.(\d+).*/', $branch, $matches1)) {
                                        $major = $matches1[1];
                                        $toUpdate = $matches1[0];
                            Severity: Minor
                            Found in src/Libs/VersionControl/Src.php - About 1 hr 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