TikiWiki/tiki-manager

View on GitHub

Showing 2,255 of 2,255 total issues

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

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $instances = CommandHelper::getInstances('no-tiki');
        $instancesInfo = CommandHelper::getInstancesInfo($instances);

Severity: Minor
Found in src/Command/RestoreInstanceCommand.php - About 2 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 isMissingPHPRequirements has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function isMissingPHPRequirements(Instance $instance, LoggerInterface $log): bool
    {
        return false;
        $missingRequirements = [];
        $access = $instance->getBestAccess();
Severity: Minor
Found in src/Command/Traits/InstanceConfigure.php - About 2 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 getSVNPath has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function getSVNPath()
    {
        $host = $this->getHost();

        $sets = [
Severity: Minor
Found in src/Access/SSH.php - About 2 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 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $helper = $this->getHelper('question');
        $status = $input->getArgument('status');
        $instancesOption = $input->getOption('instances');
Severity: Major
Found in src/Command/MaintenanceInstanceCommand.php - About 2 hrs to fix

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

        protected function execute(InputInterface $input, OutputInterface $output)
        {
            $vcsOption = $input->getOption('vcs');
            $vcsOption = $vcsOption ? strtoupper($vcsOption) : '';
            if (! in_array($vcsOption, ['SVN', 'GIT', 'SRC'])) {
    Severity: Major
    Found in src/Command/TikiVersionCommand.php - About 2 hrs to fix

      Backup has 23 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Backup
      {
          public const FULL_BACKUP = 'full';
          public const PARTIAL_BACKUP = 'partial';
      
      
      Severity: Minor
      Found in src/Application/Backup.php - About 2 hrs to fix

        File Password.php has 269 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
        
        namespace TikiManager\Ext;
        
        
        Severity: Minor
        Found in src/Ext/Password.php - About 2 hrs to fix

          Method detectWebrootOS has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function detectWebrootOS()
              {
                  $user = $this->detectUser();
                  $domain = parse_url($this->instance->weburl)['host'];
          
          
          Severity: Major
          Found in src/Application/Discovery/VirtualminDiscovery.php - About 2 hrs to fix

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

                protected function interact(InputInterface $input, OutputInterface $output)
                {
                    if (empty($input->getOption('instance'))) {
                        if (empty($this->instancesInfo)) {
                            return;
            Severity: Minor
            Found in src/Command/TagAddOrEditCommand.php - About 2 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 getHost has a Cognitive Complexity of 18 (exceeds 5 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 2 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 getBranch has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getBranch($refresh = false)
                {
                    if ($this->branch && !$refresh) {
                        return $this->branch;
                    }
            Severity: Minor
            Found in src/Application/Tiki.php - About 2 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 arrayFlatten has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function arrayFlatten($array, $objectFlat = false)
                {
                    $result = [];
                    $visited = [];
                    $queue = [];
            Severity: Minor
            Found in src/Libs/Helpers/ApplicationHelper.php - About 2 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 _mysqldump_table_data has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function _mysqldump_table_data($table)
            {
                $sql = "select COUNT(*) from `$table`;";
                $result = query($sql);
                $num_rows = fetch_row($result);
            Severity: Major
            Found in scripts/tiki/mysqldump.php - About 2 hrs to fix

              File FTP.php has 265 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/FTP.php - About 2 hrs to fix

                Method execute has 57 lines of code (exceeds 25 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: Major
                Found in src/Command/DetectInstanceCommand.php - About 2 hrs to fix

                  Method getBranch has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getBranch($refresh = false)
                      {
                          if ($this->branch && !$refresh) {
                              return $this->branch;
                          }
                  Severity: Major
                  Found in src/Application/Tiki.php - About 2 hrs to fix

                    Method performUpdate has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function performUpdate(Instance $instance, $version = null, $options = [])
                        {
                            $current = $instance->getLatestVersion();
                    
                            if (is_null($version)) {
                    Severity: Major
                    Found in src/Application/Application.php - About 2 hrs to fix

                      Function execute has a Cognitive Complexity of 17 (exceeds 5 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: Minor
                      Found in src/Command/UpgradeInstanceCommand.php - About 2 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 17 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function execute(InputInterface $input, OutputInterface $output)
                          {
                              $vcsOption = $input->getOption('vcs');
                              $vcsOption = $vcsOption ? strtoupper($vcsOption) : '';
                              if (! in_array($vcsOption, ['SVN', 'GIT', 'SRC'])) {
                      Severity: Minor
                      Found in src/Command/TikiVersionCommand.php - About 2 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 interact has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function interact(InputInterface $input, OutputInterface $output)
                          {
                              $instanceId = $input->getOption('instance');
                              if (empty($instanceId)) {
                                  $instances = CommandHelper::getInstances('tiki');
                      Severity: Major
                      Found in src/Command/CreateTemporaryUserInstanceCommand.php - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language