TikiWiki/tiki-manager

View on GitHub

Showing 332 of 2,142 total issues

Function performUpdate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function performUpdate(Instance $instance, $version = null, $options = [])
    {
        $current = $instance->getLatestVersion();

        if (is_null($version)) {
Severity: Minor
Found in src/Application/Application.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 update has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function update(string $targetFolder, string $branch, int $lag = 0)
    {
        $commitSHA = null;
        $fetchOptions = [];
        $time = time() - $lag * 60 * 60 * 24;
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

Function rsync has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function rsync($args = [])
    {
        $return_val = -1;
        if (empty($args['src']) || empty($args['dest'])) {
            return $return_val;
Severity: Minor
Found in src/Libs/Host/SSH.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 getBranchToUpdate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function getBranchToUpdate($branch)
    {
        if (preg_match('/(\d+)\.(\d+).*/', $branch, $matches1)) {
            $major = $matches1[1];
            $toUpdate = $matches1[0];
Severity: Minor
Found in src/Libs/VersionControl/Src.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 mergeWithExistingEnvironmentVariables has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    protected function mergeWithExistingEnvironmentVariables($newEnvironmentVariables)
    {
        $env = [];

        // getenv will only return all env variables starting 7.1.0
Severity: Minor
Found in src/Libs/Host/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

Method validateInstanceSelection has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function validateInstanceSelection($answer, $instances)
    {
        if (empty($answer)) {
            throw new \RuntimeException(
                'You must select an instance #ID'
Severity: Minor
Found in src/Command/Helper/CommandHelper.php - About 1 hr to fix

    Method getInterpreterPath has 31 lines of code (exceeds 25 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/SSH.php - About 1 hr to fix

      Method updateInstanceTo has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function updateInstanceTo($path, $branch)
          {
              $info = $this->info($path);
              $root = $info['repository']['root'];
              $url = $info['url'];
      Severity: Minor
      Found in src/Repository/SVN.php - About 1 hr to fix

        Method installNodeJsDependencies has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function installNodeJsDependencies()
            {
                if (! $this->supportsNodeJSBuild()) {
                    return;
                }
        Severity: Minor
        Found in src/Application/Tiki.php - About 1 hr to fix

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

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

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

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

              Method getInterpreterPath has 30 lines of code (exceeds 25 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

                Method php has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function php()
                {
                
                    if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
                        $paths = `where php`;
                Severity: Minor
                Found in src/Libs/Helpers/functions.php - About 1 hr to fix

                  Method installComposerDependencies has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function installComposerDependencies()
                      {
                          $this->io->writeln('Installing composer dependencies... <fg=yellow>[may take a while]</>');
                  
                          $instance = $this->instance;
                  Severity: Minor
                  Found in src/Application/Tiki.php - About 1 hr to fix

                    Method runCommands has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function runCommands($commands, $output = false)
                        {
                            if (!is_array($commands)) {
                                $commands = func_get_args();
                            }
                    Severity: Minor
                    Found in src/Libs/Host/Local.php - About 1 hr to fix

                      Method exec has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function exec($targetFolder, $toAppend)
                          {
                              static $tmpFolderChecked;
                              if ((empty($tmpFolderChecked) || !in_array(
                                  $targetFolder,
                      Severity: Minor
                      Found in src/Libs/VersionControl/Svn.php - About 1 hr to fix

                        Method checkSshKey has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function checkSshKey()
                            {
                                $params = [
                                    '-i',
                                    $_ENV['SSH_KEY'],
                        Severity: Minor
                        Found in src/Libs/Host/SSH.php - About 1 hr to fix

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

                            Method modify has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function modify($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 createUnpronounceable has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private static function createUnpronounceable($length, $chars)
                                  {
                                      global $_Text_Password_NumberOfPossibleCharacters;
                              
                                      $password = '';
                              Severity: Minor
                              Found in src/Ext/Password.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language