TikiWiki/tiki-manager

View on GitHub

Showing 332 of 2,142 total issues

Method remove has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function remove($helper, $input, $output)
    {
        $report = new ReportManager;
        $instances = $report->getReportInstances();
        $instancesInfo = CommandHelper::getInstancesInfo($instances);
Severity: Minor
Found in src/Command/ReportManagerCommand.php - About 1 hr to fix

    Method interact has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function interact(InputInterface $input, OutputInterface $output)
        {
            if (empty($input->getOption('time'))) {
                $answer = $this->io->ask('What time should it run at?', '00:00', function ($answer) {
                    return CommandHelper::validateTimeInput($answer);
    Severity: Minor
    Found in src/Command/SetupUpdateCommand.php - About 1 hr to fix

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

          protected function execute(InputInterface $input, OutputInterface $output)
          {
              $output->writeln('<comment>WARNING!</comment>');
              $output->writeln('<comment>You are about to delete all state, backup, cache, and log files!</comment>');
      
      
      Severity: Minor
      Found in src/Command/ResetManagerCommand.php - About 1 hr to fix

        Method renderInstancesTable has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function renderInstancesTable($output, $rows, bool $all_infos = false)
            {
                if (empty($rows)) {
                    return false;
                }
        Severity: Minor
        Found in src/Command/Helper/CommandHelper.php - About 1 hr to fix

          Method interact has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Method execute has 28 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/ConsoleInstanceCommand.php - About 1 hr to fix

              Method extractTo has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function extractTo(Version $version, $folder): void
                  {
                      $dirExists = file_exists($folder);
              
                      if ($dirExists && preg_match('/tags\\//', $version->branch)) {
              Severity: Minor
              Found in src/Application/Tiki.php - About 1 hr to fix

                Method secure_trim_data has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function secure_trim_data($should_set = false)
                {
                    $modes = ['---', '--x', '-w-', '-wx', 'r--', 'r-x', 'rw-', 'rwx'];
                    $stat = stat($_ENV['TRIM_DATA']);
                
                
                Severity: Minor
                Found in src/Libs/Helpers/functions.php - About 1 hr to fix

                  Method runCommand has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function runCommand($command, $options = [])
                      {
                          $handle = self::getExtHandle();
                          $cwd = !empty($options['cwd']) ? $options['cwd'] : $this->location;
                          $env = !empty($options['env']) ? $options['env'] : $this->env;
                  Severity: Minor
                  Found in src/Libs/Host/SSHSeclibAdapter.php - About 1 hr to fix

                    Function getUpgradeVersion has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private function getUpgradeVersion($instance)
                        {
                            $found_incompatibilities = false;
                            $instance->detectPHP();
                    
                    
                    Severity: Minor
                    Found in src/Command/SetupCloneManagerCommand.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 promptUser has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function promptUser($prompt, $default = false, $values = [])
                    {
                        if (!$_ENV['INTERACTIVE']) {
                            return $default;
                        }
                    Severity: Minor
                    Found in src/Libs/Helpers/functions.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 info has a Cognitive Complexity of 10 (exceeds 5 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

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

                        protected function execute(InputInterface $input, OutputInterface $output)
                        {
                            $email = $input->getOption('email');
                    
                            if (empty($email) || ! filter_var($email, FILTER_VALIDATE_EMAIL)) {
                    Severity: Minor
                    Found in src/Command/SetupWatchManagerCommand.php - About 1 hr to fix

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

                          public static function renderReportOptions($output)
                          {
                              $headers = [
                                  'Option',
                                  'Description'
                      Severity: Minor
                      Found in src/Command/Helper/CommandHelper.php - About 1 hr to fix

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

                            protected function execute(InputInterface $input, OutputInterface $output)
                            {
                                $output->writeln('<comment>Note: Only Tiki instances can enable reports.</comment>');
                        
                                $this->io->newLine();
                        Severity: Minor
                        Found in src/Command/ReportManagerCommand.php - About 1 hr to fix

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

                              private function add($helper, $input, $output)
                              {
                                  $report = new ReportManager;
                                  $instances = $report->getAvailableInstances();
                                  $instancesInfo = CommandHelper::getInstancesInfo($instances);
                          Severity: Minor
                          Found in src/Command/ReportManagerCommand.php - About 1 hr to fix

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

                                public function install(Instance $instance): Instance
                                {
                                    $checksumCheck = $this->input->getOption('check') ?? false;
                            
                                    $discovery = $instance->getDiscovery();
                            Severity: Minor
                            Found in src/Command/Traits/InstanceConfigure.php - About 1 hr to fix

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

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

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

                                    public static function validate($version_id, $current_checksums = [])
                                    {
                                
                                        $newFiles = [];
                                        $modifiedFiles = [];
                                Severity: Minor
                                Found in src/Libs/Audit/Checksum.php - About 1 hr to fix

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

                                      public function localizeFolder($remoteLocation, $localMirror)
                                      {
                                          if ($remoteLocation[0] != '/') {
                                              $remoteLocation = $this->instance->getWebPath($remoteLocation);
                                          }
                                  Severity: Minor
                                  Found in src/Access/FTP.php - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language