TikiWiki/tiki-manager

View on GitHub

Showing 332 of 2,142 total issues

Function getPassword has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

function getPassword($stars = false)
{
    // Get current style
    $oldStyle = shell_exec('stty -g');

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

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

    protected function interact(InputInterface $input, OutputInterface $output)
    {
        $this->io->note('Backups are only available on Local and SSH instances.');

        $instances = CommandHelper::getInstances('all', true);
Severity: Minor
Found in src/Command/BackupInstanceCommand.php - About 1 hr to fix

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

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

      Method getInstancesInfo has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function getInstancesInfo(array $instances, bool $all_infos = false): ?array
          {
              $instancesInfo = null;
      
              foreach ($instances as $instance) {
      Severity: Minor
      Found in src/Command/Helper/CommandHelper.php - About 1 hr to fix

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

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

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

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

            Method restoreDatabase has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function restoreDatabase(Database $database, string $remoteFile, bool $clone)
                {
                    $tmp = tempnam($_ENV['TEMP_FOLDER'], 'dblocal');
            
                    if (! empty($database->dbLocalContent)) {
            Severity: Minor
            Found in src/Application/Tiki.php - About 1 hr to fix

              Method getSVNPath has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getSVNPath()
                  {
                      $host = $this->getHost();
              
                      $sets = [
              Severity: Minor
              Found in src/Access/SSH.php - About 1 hr to fix

                Function execute has a Cognitive Complexity of 13 (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 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 setupDatabase has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function setupDatabase(Instance $instance, $reconfigure = false): Instance
                    {
                        try {
                            if (!$reconfigure && $this->testExistingDbConnection($instance)) {
                                return $instance;
                Severity: Minor
                Found in src/Command/Traits/InstanceConfigure.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 detectPHPMacOS has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function detectPHPMacOS($options = [], $searchOrder = null)
                    {
                        if ($searchOrder === null) {
                            $searchOrder = [
                                ['command', ['-v', 'php']],
                Severity: Minor
                Found in src/Application/Discovery/MacOSDiscovery.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 restoreDatabase has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function restoreDatabase(Database $database, string $remoteFile, bool $clone)
                    {
                        $tmp = tempnam($_ENV['TEMP_FOLDER'], 'dblocal');
                
                        if (! empty($database->dbLocalContent)) {
                Severity: Minor
                Found in src/Application/Tiki.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 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function info($path, $args = [])
                    {
                        if (empty($args)) {
                            $args = $this->getDefaultArgs('info');
                        }
                Severity: Minor
                Found in src/Repository/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

                Function postInstall has a Cognitive Complexity of 13 (exceeds 5 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

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

                    protected function detectPHPLinux($options = [], $searchOrder = null)
                    {
                        if ($searchOrder === null) {
                            $searchOrder = [
                                ['command', ['-v', 'php']],
                Severity: Minor
                Found in src/Application/Discovery/LinuxDiscovery.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 setSafeDirectory has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function setSafeDirectory($instance)
                    {
                        $skipSafeDir = isset($_ENV['GIT_DONT_ADD_SAFEDIR']) ? (bool) $_ENV['GIT_DONT_ADD_SAFEDIR'] : false;
                
                        if ($skipSafeDir) {
                Severity: Minor
                Found in src/Libs/VersionControl/Git.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 install has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function install(Version $version, $checksumCheck = false)
                    {
                        $access = $this->instance->getBestAccess('scripting');
                        $host = $access->getHost();
                
                
                Severity: Minor
                Found in src/Application/Tiki.php - About 1 hr to fix

                  Method setSafeDirectory has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function setSafeDirectory($instance)
                      {
                          $skipSafeDir = isset($_ENV['GIT_DONT_ADD_SAFEDIR']) ? (bool) $_ENV['GIT_DONT_ADD_SAFEDIR'] : false;
                  
                          if ($skipSafeDir) {
                  Severity: Minor
                  Found in src/Libs/VersionControl/Git.php - About 1 hr to fix

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

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

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

                          protected function setupRemoteAccess(Access $access)
                          {
                              $host = $this->io->ask('Host', $this->input->getOption('host') ?? '', function ($value) {
                                  return !empty($value) ? $value : new InvalidOptionException("You must provide a valid remote host. Please use --host=<HOST>");
                              });
                      Severity: Minor
                      Found in src/Command/Traits/InstanceConfigure.php - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language