TikiWiki/tiki-manager

View on GitHub

Showing 332 of 2,142 total issues

Method create has 34 lines of code (exceeds 25 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

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

        public function decompressArchive($folder, $archive)
        {
            $access = $this->access;
    
            $bzipStep = false;
    Severity: Minor
    Found in src/Application/Restore.php - About 1 hr to fix

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

          public function readSystemIniConfigFileFromManifest($manifest_file)
          {
              $result = [];
              $access = $this->getAccess();
              $manifest = $access->fileGetContents($manifest_file);
      Severity: Minor
      Found in src/Application/Restore.php - About 1 hr to fix

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

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

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

                          public function getUpgradeVersion(Instance $instance, bool $onlySupported, string $branch = null, Version $curVersion = null): ?Version
                          {
                              $curVersion = $curVersion ?: $instance->getLatestVersion();
                              if ($instance->getApplication()) {
                                  $versions = $instance->getApplication()->getUpgradableVersions($curVersion, $onlySupported);
                      Severity: Minor
                      Found in src/Command/Traits/InstanceUpgrade.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

                            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

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

                              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

                              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
                                Severity
                                Category
                                Status
                                Source
                                Language