TikiWiki/tiki-manager

View on GitHub

Showing 332 of 2,142 total issues

Method getHost has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getHost()
    {
        if (!(is_object($this->hostlib) && $this->hostlib instanceof LocalHost)) {
            $this->hostlib = new LocalHost();
        }
Severity: Minor
Found in src/Access/Local.php - About 1 hr to fix

    Method setupConnection has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function setupConnection()
        {
            $config = $this->instance->getDatabaseConfig();
    
            if ($config instanceof Database) {
    Severity: Minor
    Found in src/Libs/Database/Database.php - About 1 hr to fix

      Method setupApplication has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function setupApplication(Instance $instance): Instance
          {
              if ($this->input->getOption('blank')) {
                  $instance->selection = 'blank : none';
                  return $instance;
      Severity: Minor
      Found in src/Command/Traits/InstanceConfigure.php - About 1 hr to fix

        Method prepareArgs has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function prepareArgs($args)
            {
                $result = [];
                if (is_string($args)) {
                    $args = preg_split('/  */', $args);
        Severity: Minor
        Found in src/Libs/Host/Command.php - About 1 hr to fix

          Function interact has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function interact(InputInterface $input, OutputInterface $output)
              {
                  $instances = CommandHelper::getInstances('tiki');
          
                  if (empty($input->getOption('patch'))) {
          Severity: Minor
          Found in src/Command/DeletePatchCommand.php - About 55 mins 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 handleInstance has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function handleInstance(Instance $instance, InputInterface $input): Instance\CronJob
              {
                  $this->io->section($instance->name);
          
                  $instanceOS = $instance->getDiscovery()->detectOS();
          Severity: Minor
          Found in src/Command/SetupSchedulerCronInstanceCommand.php - About 55 mins 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 rotxmm has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              private static function rotxmm($login, $key)
              {
                  $tmp = '';
                  $login = strtolower($login);
          
          
          Severity: Minor
          Found in src/Ext/Password.php - About 55 mins 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 getAbsolutePath has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function getAbsolutePath($path)
              {
                  $path = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $path);
                  $parts = explode(DIRECTORY_SEPARATOR, $path);
                  $parts = array_filter($parts, 'strlen');
          Severity: Minor
          Found in src/Libs/Helpers/ApplicationHelper.php - About 55 mins 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 validate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function validate($version_id, $current_checksums = [])
              {
          
                  $newFiles = [];
                  $modifiedFiles = [];
          Severity: Minor
          Found in src/Libs/Audit/Checksum.php - About 55 mins 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 setIniFilesToExclude has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public function setIniFilesToExclude($manifest)
              {
          
                  $system_config_file_info = $this->readSystemIniConfigFileFromManifest($manifest);
          
          
          Severity: Minor
          Found in src/Application/Restore.php - About 55 mins 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 interpolate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              private function interpolate(string $message, array $context): string
              {
                  if (false === strpos($message, '{')) {
                      return $message;
                  }
          Severity: Minor
          Found in src/Logger/ConsoleLogger.php - About 55 mins 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 rotx has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              private static function rotx($login, $key)
              {
                  $tmp = '';
                  $login = strtolower($login);
          
          
          Severity: Minor
          Found in src/Ext/Password.php - About 55 mins 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 rotxpp has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              private static function rotxpp($login, $key)
              {
                  $tmp = '';
                  $login = strtolower($login);
          
          
          Severity: Minor
          Found in src/Ext/Password.php - About 55 mins 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 installComposerDependencies has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public function installComposerDependencies()
              {
                  $this->io->writeln('Installing composer dependencies... <fg=yellow>[may take a while]</>');
          
                  $instance = $this->instance;
          Severity: Minor
          Found in src/Application/Tiki.php - About 55 mins 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 runCommands has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public function runCommands($commands, $output = false)
              {
                  if (!is_array($commands)) {
                      $commands = func_get_args();
                  }
          Severity: Minor
          Found in src/Libs/Host/Local.php - About 55 mins 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

          Avoid deeply nested control flow statements.
          Open

                              if ($i < $num_fields - 1) {
                                  echo ',';
                              }
          Severity: Major
          Found in scripts/tiki/mysqldump.php - About 45 mins to fix

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

                protected function execute(InputInterface $input, OutputInterface $output)
                {
                    $updater = UpdateManager::getUpdater();
                    $updater->setLogger($this->logger);
            
            
            Severity: Minor
            Found in src/Command/ManagerUpdateCommand.php - About 45 mins 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 clearFolderContents has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function clearFolderContents($dirs, LoggerInterface $logger)
                {
                    if (!is_array($dirs)) {
                        $dirs = [$dirs];
                    }
            Severity: Minor
            Found in src/Command/Helper/CommandHelper.php - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function execute(InputInterface $input, OutputInterface $output)
                {
                    $this->printManagerInfo();
            
                    $this->io->title('New Instance Setup');
            Severity: Minor
            Found in src/Command/CreateInstanceCommand.php - About 45 mins 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 setupApplication has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public function setupApplication(Instance $instance): Instance
                {
                    if ($this->input->getOption('blank')) {
                        $instance->selection = 'blank : none';
                        return $instance;
            Severity: Minor
            Found in src/Command/Traits/InstanceConfigure.php - About 45 mins 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