TikiWiki/tiki-manager

View on GitHub

Showing 332 of 2,142 total issues

Method windowsSync has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function windowsSync($remoteLocation, $localMirror, $files = [], $exclusions = [])
    {

        $exclude = '';
        $returnVar = 0;
Severity: Minor
Found in src/Libs/Host/Local.php - About 1 hr to fix

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

        protected function execute(InputInterface $input, OutputInterface $output)
        {
            $time = $input->getOption('time');
            list($hours, $minutes) = CommandHelper::validateTimeInput($time);
            $arguments = '--instances=all --no-interaction';
    Severity: Minor
    Found in src/Command/SetupBackupManagerCommand.php - About 1 hr to fix

      Method interact has 37 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/SetupBackupManagerCommand.php - About 1 hr to fix

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

            protected function execute(InputInterface $input, OutputInterface $output)
            {
                $instance = new Instance();
                try {
                    if ($input->isInteractive()) {
        Severity: Minor
        Found in src/Command/ImportInstanceCommand.php - About 1 hr to fix

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

              protected function interact(InputInterface $input, OutputInterface $output)
              {
                  $helper = $this->getHelper('question');
                  $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 handleInstance has 36 lines of code (exceeds 25 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 1 hr to fix

              Method fixPermissions has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function fixPermissions($path)
                  {
                      $filesystem = new Filesystem();
                      $perm = $this->getFilePerm();
                      $user = $this->getFileUser();
              Severity: Minor
              Found in src/Application/Backup.php - About 1 hr to fix

                Method postInstall has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function postInstall(array $options = [])
                    {
                        $access = $this->instance->getBestAccess('scripting');
                        $access->getHost(); // trigger the config of the location change (to catch phpenv)
                
                
                Severity: Minor
                Found in src/Application/Tiki.php - About 1 hr to fix

                  Method cleanup has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function cleanup($instanceId, $instanceName, $maxBackups = 0)
                      {
                          $backup_directory = "{$instanceId}-{$instanceName}";
                  
                          $files = glob($_ENV['ARCHIVE_FOLDER'] . "/$backup_directory" . '/*.tar.bz2');
                  Severity: Minor
                  Found in src/Libs/Helpers/Archive.php - About 1 hr to fix

                    Method fixPermissions has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function fixPermissions()
                        {
                            $instance = $this->instance;
                            $access = $instance->getBestAccess('scripting');
                    
                    
                    Severity: Minor
                    Found in src/Application/Tiki.php - About 1 hr to fix

                      Method getDetails has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function getDetails($instance)
                          {
                              $archives = $instance->getArchives();
                      
                              if (count($archives) > 0) {
                      Severity: Minor
                      Found in src/Report/Backup.php - About 1 hr to fix

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

                            protected function execute(InputInterface $input, OutputInterface $output)
                            {
                                $instances = CommandHelper::getInstances('tiki');
                                $instancesInfo = CommandHelper::getInstancesInfo($instances);
                                $package = $input->getOption('package');
                        Severity: Minor
                        Found in src/Command/ApplyPatchCommand.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 getInterpreterPath has a Cognitive Complexity of 12 (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/Local.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 readSystemIniConfigFileFromManifest has a Cognitive Complexity of 12 (exceeds 5 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

                        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 fixPermissions has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function fixPermissions($path)
                            {
                                $filesystem = new Filesystem();
                                $perm = $this->getFilePerm();
                                $user = $this->getFileUser();
                        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 execute has 35 lines of code (exceeds 25 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

                          Method execute has 35 lines of code (exceeds 25 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 1 hr to fix

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

                                protected function configure()
                                {
                                    parent::configure();
                            
                                    $this
                            Severity: Minor
                            Found in src/Command/BackupInstanceCommand.php - About 1 hr to fix

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

                                  protected function configure()
                                  {
                                      $this
                                          ->setName('instance:checkout')
                                          ->setDescription('Checkout a different branch or revision on an underlying Git controlled source.')
                              Severity: Minor
                              Found in src/Command/CheckoutCommand.php - About 1 hr to fix

                                Method interact has 34 lines of code (exceeds 25 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 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language