TikiWiki/tiki-manager

View on GitHub

Showing 332 of 2,142 total issues

Discovery has 24 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class Discovery
{
    protected $access;
    protected $instance;
    protected $config;
Severity: Minor
Found in src/Application/Discovery.php - About 2 hrs to fix

    Method configure has 65 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

      Method isMissingPHPRequirements has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function isMissingPHPRequirements(Instance $instance, LoggerInterface $log): bool
          {
              return false;
              $missingRequirements = [];
              $access = $instance->getBestAccess();
      Severity: Major
      Found in src/Command/Traits/InstanceConfigure.php - About 2 hrs to fix

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

                  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

                  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

                    Method configure has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

                      Src has 22 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      class Src extends VersionControlSystem
                      {
                          use FileArchive;
                      
                          public static $pattern = '/tiki-(.*)\.(tar\.bz2|zip|7z|tar\.gz)/';
                      Severity: Minor
                      Found in src/Libs/VersionControl/Src.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

                              File FTP.php has 261 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
                                Severity
                                Category
                                Status
                                Source
                                Language