TikiWiki/tiki-manager

View on GitHub
src/Application/Tiki.php

Summary

Maintainability
F
1 wk
Test Coverage

applyPatch accesses the super-global variable $_ENV.
Open

    public function applyPatch(Patch $patch, $options)
    {
        $access = $this->instance->getBestAccess('scripting');
        $vcsType = $this->vcs_instance->getIdentifier();
        $can_patch = $access->hasExecutable('patch');
Severity: Minor
Found in src/Application/Tiki.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

installComposer accesses the super-global variable $_ENV.
Open

    public function installComposer()
    {
        if ($this->instance->getBestAccess()->fileExists('temp/composer.phar')) {
            return;
        }
Severity: Minor
Found in src/Application/Tiki.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

getSystemIniConfigFilePath accesses the super-global variable $_ENV.
Open

    public function getSystemIniConfigFilePath()
    {
        $access = $this->instance->getBestAccess('scripting');
        $out = $access->runPHP(
            $_ENV['TRIM_ROOT'] . '/scripts/tiki/get_system_config_ini_file.php',
Severity: Minor
Found in src/Application/Tiki.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

updateTikiPackages accesses the super-global variable $_ENV.
Open

    protected function updateTikiPackages(): bool
    {
        $access = $this->instance->getBestAccess();
        $command = $access->createCommand(
            $this->instance->phpexec,
Severity: Minor
Found in src/Application/Tiki.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

getSourceFile accesses the super-global variable $_ENV.
Open

    public function getSourceFile(Version $version, $filename)
    {
        $dot = strrpos($filename, '.');
        $ext = substr($filename, $dot);

Severity: Minor
Found in src/Application/Tiki.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

installComposerDependencies accesses the super-global variable $_ENV.
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 by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

setupDatabase accesses the super-global variable $_ENV.
Open

    public function setupDatabase(Database $database)
    {
        $tmp = tempnam($_ENV['TEMP_FOLDER'], 'dblocal');
        $dbFileContents = $this->generateDbFileContent($database);
        file_put_contents($tmp, $dbFileContents);
Severity: Minor
Found in src/Application/Tiki.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

getSourceFile accesses the super-global variable $_ENV.
Open

    public function getSourceFile(Version $version, $filename)
    {
        $dot = strrpos($filename, '.');
        $ext = substr($filename, $dot);

Severity: Minor
Found in src/Application/Tiki.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

installNodeJsDependencies accesses the super-global variable $_ENV.
Open

    public function installNodeJsDependencies()
    {
        if (! $this->supportsNodeJSBuild()) {
            return;
        }
Severity: Minor
Found in src/Application/Tiki.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

restoreDatabase accesses the super-global variable $_ENV.
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 by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

installComposerDependencies accesses the super-global variable $_ENV.
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 by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

installTikiPackages accesses the super-global variable $_ENV.
Open

    public function installTikiPackages(bool $update = false)
    {
        $instance = $this->instance;
        $access = $instance->getBestAccess();

Severity: Minor
Found in src/Application/Tiki.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

installNodeJsDependencies accesses the super-global variable $_ENV.
Open

    public function installNodeJsDependencies()
    {
        if (! $this->supportsNodeJSBuild()) {
            return;
        }
Severity: Minor
Found in src/Application/Tiki.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

fixPermissions accesses the super-global variable $_ENV.
Open

    public function fixPermissions()
    {
        $instance = $this->instance;
        $access = $instance->getBestAccess('scripting');

Severity: Minor
Found in src/Application/Tiki.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

installComposer accesses the super-global variable $_ENV.
Open

    public function installComposer()
    {
        if ($this->instance->getBestAccess()->fileExists('temp/composer.phar')) {
            return;
        }
Severity: Minor
Found in src/Application/Tiki.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

File Tiki.php has 1070 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: Major
Found in src/Application/Tiki.php - About 2 days to fix

    Tiki has 58 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Tiki extends Application
    {
        private $installType = null;
        private $branch = null;
        private $installed = null;
    Severity: Major
    Found in src/Application/Tiki.php - About 1 day to fix

      Function applyPatch has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

          public function applyPatch(Patch $patch, $options)
          {
              $access = $this->instance->getBestAccess('scripting');
              $vcsType = $this->vcs_instance->getIdentifier();
              $can_patch = $access->hasExecutable('patch');
      Severity: Minor
      Found in src/Application/Tiki.php - About 3 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

      The class Tiki has 34 non-getter- and setter-methods. Consider refactoring Tiki to keep number of methods under 25.
      Open

      class Tiki extends Application
      {
          private $installType = null;
          private $branch = null;
          private $installed = null;
      Severity: Minor
      Found in src/Application/Tiki.php by phpmd

      TooManyMethods

      Since: 0.1

      A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

      By default it ignores methods starting with 'get' or 'set'.

      The default was changed from 10 to 25 in PHPMD 2.3.

      Example

      Source https://phpmd.org/rules/codesize.html#toomanymethods

      The class Tiki has an overall complexity of 265 which is very high. The configured complexity threshold is 50.
      Open

      class Tiki extends Application
      {
          private $installType = null;
          private $branch = null;
          private $installed = null;
      Severity: Minor
      Found in src/Application/Tiki.php by phpmd

      The class Tiki has 25 public methods. Consider refactoring Tiki to keep number of public methods under 10.
      Open

      class Tiki extends Application
      {
          private $installType = null;
          private $branch = null;
          private $installed = null;
      Severity: Minor
      Found in src/Application/Tiki.php by phpmd

      TooManyPublicMethods

      Since: 0.1

      A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

      By default it ignores methods starting with 'get' or 'set'.

      Example

      Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

      Function fixPermissions has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          public function fixPermissions()
          {
              $instance = $this->instance;
              $access = $instance->getBestAccess('scripting');
      
      
      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 applyPatch has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function applyPatch(Patch $patch, $options)
          {
              $access = $this->instance->getBestAccess('scripting');
              $vcsType = $this->vcs_instance->getIdentifier();
              $can_patch = $access->hasExecutable('patch');
      Severity: Major
      Found in src/Application/Tiki.php - About 2 hrs to fix

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

              public function setupDatabase(Database $database)
              {
                  $tmp = tempnam($_ENV['TEMP_FOLDER'], 'dblocal');
                  $dbFileContents = $this->generateDbFileContent($database);
                  file_put_contents($tmp, $dbFileContents);
          Severity: Minor
          Found in src/Application/Tiki.php - About 2 hrs to fix

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

                public function getLocalCheckouts()
                {
                    $access = $this->instance->getBestAccess('scripting');
                    $access->chdir($this->instance->webroot);
                    $command = $access->createCommand('find', ['.', '-type', 'd', '-name', '.git']);
            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

            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

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

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

                        The class Tiki has 50 public methods and attributes. Consider reducing the number of public items to less than 45.
                        Open

                        class Tiki extends Application
                        {
                            private $installType = null;
                            private $branch = null;
                            private $installed = null;
                        Severity: Minor
                        Found in src/Application/Tiki.php by phpmd

                        ExcessivePublicCount

                        Since: 0.1

                        A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.

                        Example

                        public class Foo {
                            public $value;
                            public $something;
                            public $var;
                            // [... more more public attributes ...]
                        
                            public function doWork() {}
                            public function doMoreWork() {}
                            public function doWorkAgain() {}
                            // [... more more public methods ...]
                        }

                        Source https://phpmd.org/rules/codesize.html#excessivepubliccount

                        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

                          Function installComposerDependencies has a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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 performActualUpdate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function performActualUpdate(Version $version, $options = [])
                              {
                                  $access = $this->instance->getBestAccess('scripting');
                                  $vcsType = $this->vcs_instance->getIdentifier();
                                  $can_svn = $access->hasExecutable('svn') && $vcsType == 'SVN';
                          Severity: Minor
                          Found in src/Application/Tiki.php - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function setupDatabase(Database $database)
                              {
                                  $tmp = tempnam($_ENV['TEMP_FOLDER'], 'dblocal');
                                  $dbFileContents = $this->generateDbFileContent($database);
                                  file_put_contents($tmp, $dbFileContents);
                          Severity: Minor
                          Found in src/Application/Tiki.php - About 45 mins 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 getCompatibleVersions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function getCompatibleVersions(bool $withBlank = true)
                              {
                                  $versions = $this->getVersions();
                                  $checkTikiVersionRequirement = $this->getTikiRequirementsHelper();
                                  $compatible = [];
                          Severity: Minor
                          Found in src/Application/Tiki.php - About 45 mins 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 getFileLocations has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function getFileLocations()
                              {
                                  $access = $this->instance->getBestAccess('scripting');
                                  $webroot = rtrim($this->instance->webroot, '/');
                                  $out = $access->runPHP(
                          Severity: Minor
                          Found in src/Application/Tiki.php - About 35 mins 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 install has a Cognitive Complexity of 7 (exceeds 5 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 35 mins 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 extractTo has a Cognitive Complexity of 7 (exceeds 5 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 35 mins 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

                          Avoid too many return statements within this method.
                          Open

                                          return $this->branch = $entry;
                          Severity: Major
                          Found in src/Application/Tiki.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                        return true;
                            Severity: Major
                            Found in src/Application/Tiki.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                      return $this->branch = $branch;
                              Severity: Major
                              Found in src/Application/Tiki.php - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                        return $files;
                                Severity: Major
                                Found in src/Application/Tiki.php - About 30 mins to fix

                                  Function installTikiPackages has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function installTikiPackages(bool $update = false)
                                      {
                                          $instance = $this->instance;
                                          $access = $instance->getBestAccess();
                                  
                                  
                                  Severity: Minor
                                  Found in src/Application/Tiki.php - About 25 mins 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 getInstallType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function getInstallType($refresh = false)
                                      {
                                          if (! is_null($this->installType) && !$refresh) {
                                              return $this->installType;
                                          }
                                  Severity: Minor
                                  Found in src/Application/Tiki.php - About 25 mins 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 installComposer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function installComposer()
                                      {
                                          if ($this->instance->getBestAccess()->fileExists('temp/composer.phar')) {
                                              return;
                                          }
                                  Severity: Minor
                                  Found in src/Application/Tiki.php - About 25 mins 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 installNodeJsDependencies has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public function installNodeJsDependencies()
                                      {
                                          if (! $this->supportsNodeJSBuild()) {
                                              return;
                                          }
                                  Severity: Minor
                                  Found in src/Application/Tiki.php - About 25 mins 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

                                  The class Tiki has 1457 lines of code. Current threshold is 1000. Avoid really long classes.
                                  Open

                                  class Tiki extends Application
                                  {
                                      private $installType = null;
                                      private $branch = null;
                                      private $installed = null;
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  The method installComposerDependencies() has an NPath complexity of 1152. The configured NPath complexity threshold is 200.
                                  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 by phpmd

                                  NPathComplexity

                                  Since: 0.1

                                  The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                                  Example

                                  class Foo {
                                      function bar() {
                                          // lots of complicated code
                                      }
                                  }

                                  Source https://phpmd.org/rules/codesize.html#npathcomplexity

                                  The method getBranch() has an NPath complexity of 324. The configured NPath complexity threshold is 200.
                                  Open

                                      public function getBranch($refresh = false)
                                      {
                                          if ($this->branch && !$refresh) {
                                              return $this->branch;
                                          }
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  NPathComplexity

                                  Since: 0.1

                                  The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                                  Example

                                  class Foo {
                                      function bar() {
                                          // lots of complicated code
                                      }
                                  }

                                  Source https://phpmd.org/rules/codesize.html#npathcomplexity

                                  The method applyPatch() has an NPath complexity of 720. The configured NPath complexity threshold is 200.
                                  Open

                                      public function applyPatch(Patch $patch, $options)
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_patch = $access->hasExecutable('patch');
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  NPathComplexity

                                  Since: 0.1

                                  The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

                                  Example

                                  class Foo {
                                      function bar() {
                                          // lots of complicated code
                                      }
                                  }

                                  Source https://phpmd.org/rules/codesize.html#npathcomplexity

                                  The method getBranch() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
                                  Open

                                      public function getBranch($refresh = false)
                                      {
                                          if ($this->branch && !$refresh) {
                                              return $this->branch;
                                          }
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CyclomaticComplexity

                                  Since: 0.1

                                  Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                  Example

                                  // Cyclomatic Complexity = 11
                                  class Foo {
                                  1   public function example() {
                                  2       if ($a == $b) {
                                  3           if ($a1 == $b1) {
                                                  fiddle();
                                  4           } elseif ($a2 == $b2) {
                                                  fiddle();
                                              } else {
                                                  fiddle();
                                              }
                                  5       } elseif ($c == $d) {
                                  6           while ($c == $d) {
                                                  fiddle();
                                              }
                                  7        } elseif ($e == $f) {
                                  8           for ($n = 0; $n < $h; $n++) {
                                                  fiddle();
                                              }
                                          } else {
                                              switch ($z) {
                                  9               case 1:
                                                      fiddle();
                                                      break;
                                  10              case 2:
                                                      fiddle();
                                                      break;
                                  11              case 3:
                                                      fiddle();
                                                      break;
                                                  default:
                                                      fiddle();
                                                      break;
                                              }
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                  The method installComposerDependencies() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
                                  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 by phpmd

                                  CyclomaticComplexity

                                  Since: 0.1

                                  Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                  Example

                                  // Cyclomatic Complexity = 11
                                  class Foo {
                                  1   public function example() {
                                  2       if ($a == $b) {
                                  3           if ($a1 == $b1) {
                                                  fiddle();
                                  4           } elseif ($a2 == $b2) {
                                                  fiddle();
                                              } else {
                                                  fiddle();
                                              }
                                  5       } elseif ($c == $d) {
                                  6           while ($c == $d) {
                                                  fiddle();
                                              }
                                  7        } elseif ($e == $f) {
                                  8           for ($n = 0; $n < $h; $n++) {
                                                  fiddle();
                                              }
                                          } else {
                                              switch ($z) {
                                  9               case 1:
                                                      fiddle();
                                                      break;
                                  10              case 2:
                                                      fiddle();
                                                      break;
                                  11              case 3:
                                                      fiddle();
                                                      break;
                                                  default:
                                                      fiddle();
                                                      break;
                                              }
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                  The method performActualUpdate() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
                                  Open

                                      public function performActualUpdate(Version $version, $options = [])
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_svn = $access->hasExecutable('svn') && $vcsType == 'SVN';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CyclomaticComplexity

                                  Since: 0.1

                                  Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                  Example

                                  // Cyclomatic Complexity = 11
                                  class Foo {
                                  1   public function example() {
                                  2       if ($a == $b) {
                                  3           if ($a1 == $b1) {
                                                  fiddle();
                                  4           } elseif ($a2 == $b2) {
                                                  fiddle();
                                              } else {
                                                  fiddle();
                                              }
                                  5       } elseif ($c == $d) {
                                  6           while ($c == $d) {
                                                  fiddle();
                                              }
                                  7        } elseif ($e == $f) {
                                  8           for ($n = 0; $n < $h; $n++) {
                                                  fiddle();
                                              }
                                          } else {
                                              switch ($z) {
                                  9               case 1:
                                                      fiddle();
                                                      break;
                                  10              case 2:
                                                      fiddle();
                                                      break;
                                  11              case 3:
                                                      fiddle();
                                                      break;
                                                  default:
                                                      fiddle();
                                                      break;
                                              }
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                  The method installTikiPackages() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
                                  Open

                                      public function installTikiPackages(bool $update = false)
                                      {
                                          $instance = $this->instance;
                                          $access = $instance->getBestAccess();
                                  
                                  
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CyclomaticComplexity

                                  Since: 0.1

                                  Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                  Example

                                  // Cyclomatic Complexity = 11
                                  class Foo {
                                  1   public function example() {
                                  2       if ($a == $b) {
                                  3           if ($a1 == $b1) {
                                                  fiddle();
                                  4           } elseif ($a2 == $b2) {
                                                  fiddle();
                                              } else {
                                                  fiddle();
                                              }
                                  5       } elseif ($c == $d) {
                                  6           while ($c == $d) {
                                                  fiddle();
                                              }
                                  7        } elseif ($e == $f) {
                                  8           for ($n = 0; $n < $h; $n++) {
                                                  fiddle();
                                              }
                                          } else {
                                              switch ($z) {
                                  9               case 1:
                                                      fiddle();
                                                      break;
                                  10              case 2:
                                                      fiddle();
                                                      break;
                                  11              case 3:
                                                      fiddle();
                                                      break;
                                                  default:
                                                      fiddle();
                                                      break;
                                              }
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                  The method fixPermissions() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
                                  Open

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

                                  CyclomaticComplexity

                                  Since: 0.1

                                  Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                  Example

                                  // Cyclomatic Complexity = 11
                                  class Foo {
                                  1   public function example() {
                                  2       if ($a == $b) {
                                  3           if ($a1 == $b1) {
                                                  fiddle();
                                  4           } elseif ($a2 == $b2) {
                                                  fiddle();
                                              } else {
                                                  fiddle();
                                              }
                                  5       } elseif ($c == $d) {
                                  6           while ($c == $d) {
                                                  fiddle();
                                              }
                                  7        } elseif ($e == $f) {
                                  8           for ($n = 0; $n < $h; $n++) {
                                                  fiddle();
                                              }
                                          } else {
                                              switch ($z) {
                                  9               case 1:
                                                      fiddle();
                                                      break;
                                  10              case 2:
                                                      fiddle();
                                                      break;
                                  11              case 3:
                                                      fiddle();
                                                      break;
                                                  default:
                                                      fiddle();
                                                      break;
                                              }
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                  The method restoreDatabase() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
                                  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 by phpmd

                                  CyclomaticComplexity

                                  Since: 0.1

                                  Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                  Example

                                  // Cyclomatic Complexity = 11
                                  class Foo {
                                  1   public function example() {
                                  2       if ($a == $b) {
                                  3           if ($a1 == $b1) {
                                                  fiddle();
                                  4           } elseif ($a2 == $b2) {
                                                  fiddle();
                                              } else {
                                                  fiddle();
                                              }
                                  5       } elseif ($c == $d) {
                                  6           while ($c == $d) {
                                                  fiddle();
                                              }
                                  7        } elseif ($e == $f) {
                                  8           for ($n = 0; $n < $h; $n++) {
                                                  fiddle();
                                              }
                                          } else {
                                              switch ($z) {
                                  9               case 1:
                                                      fiddle();
                                                      break;
                                  10              case 2:
                                                      fiddle();
                                                      break;
                                  11              case 3:
                                                      fiddle();
                                                      break;
                                                  default:
                                                      fiddle();
                                                      break;
                                              }
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                  The method applyPatch() has a Cyclomatic Complexity of 15. The configured cyclomatic complexity threshold is 10.
                                  Open

                                      public function applyPatch(Patch $patch, $options)
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_patch = $access->hasExecutable('patch');
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CyclomaticComplexity

                                  Since: 0.1

                                  Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                  Example

                                  // Cyclomatic Complexity = 11
                                  class Foo {
                                  1   public function example() {
                                  2       if ($a == $b) {
                                  3           if ($a1 == $b1) {
                                                  fiddle();
                                  4           } elseif ($a2 == $b2) {
                                                  fiddle();
                                              } else {
                                                  fiddle();
                                              }
                                  5       } elseif ($c == $d) {
                                  6           while ($c == $d) {
                                                  fiddle();
                                              }
                                  7        } elseif ($e == $f) {
                                  8           for ($n = 0; $n < $h; $n++) {
                                                  fiddle();
                                              }
                                          } else {
                                              switch ($z) {
                                  9               case 1:
                                                      fiddle();
                                                      break;
                                  10              case 2:
                                                      fiddle();
                                                      break;
                                  11              case 3:
                                                      fiddle();
                                                      break;
                                                  default:
                                                      fiddle();
                                                      break;
                                              }
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                  Avoid using undefined variables such as '$folders' which will lead to PHP notices.
                                  Open

                                                  $folders['data'][] = $line;
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  UndefinedVariable

                                  Since: 2.8.0

                                  Detects when a variable is used that has not been defined before.

                                  Example

                                  class Foo
                                  {
                                      private function bar()
                                      {
                                          // $message is undefined
                                          echo $message;
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                  Avoid using undefined variables such as '$folders' which will lead to PHP notices.
                                  Open

                                          return $folders;
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  UndefinedVariable

                                  Since: 2.8.0

                                  Detects when a variable is used that has not been defined before.

                                  Example

                                  class Foo
                                  {
                                      private function bar()
                                      {
                                          // $message is undefined
                                          echo $message;
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                  Avoid using undefined variables such as '$folders' which will lead to PHP notices.
                                  Open

                                          $folders['app'] = [$webroot];
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  UndefinedVariable

                                  Since: 2.8.0

                                  Detects when a variable is used that has not been defined before.

                                  Example

                                  class Foo
                                  {
                                      private function bar()
                                      {
                                          // $message is undefined
                                          echo $message;
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#undefinedvariable

                                  The class Tiki has a coupling between objects value of 23. Consider to reduce the number of dependencies under 13.
                                  Open

                                  class Tiki extends Application
                                  {
                                      private $installType = null;
                                      private $branch = null;
                                      private $installed = null;
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CouplingBetweenObjects

                                  Since: 1.1.0

                                  A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                                  Example

                                  class Foo {
                                      /**
                                       * @var \foo\bar\X
                                       */
                                      private $x = null;
                                  
                                      /**
                                       * @var \foo\bar\Y
                                       */
                                      private $y = null;
                                  
                                      /**
                                       * @var \foo\bar\Z
                                       */
                                      private $z = null;
                                  
                                      public function setFoo(\Foo $foo) {}
                                      public function setBar(\Bar $bar) {}
                                      public function setBaz(\Baz $baz) {}
                                  
                                      /**
                                       * @return \SplObjectStorage
                                       * @throws \OutOfRangeException
                                       * @throws \InvalidArgumentException
                                       * @throws \ErrorException
                                       */
                                      public function process(\Iterator $it) {}
                                  
                                      // ...
                                  }

                                  Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                                  The method install has a boolean flag argument $checksumCheck, which is a certain sign of a Single Responsibility Principle violation.
                                  Open

                                      public function install(Version $version, $checksumCheck = false)
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  BooleanArgumentFlag

                                  Since: 1.4.0

                                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                                  Example

                                  class Foo {
                                      public function bar($flag = true) {
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                                  Missing class import via use statement (line '1035', column '23').
                                  Open

                                              throw new \Exception("Composer install failed for {$bundled}composer.lock (Tiki bundled packages).\nCheck " . $_ENV['TRIM_OUTPUT'] . " for more details.");
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  MissingImport

                                  Since: 2.7.0

                                  Importing all external classes in a file through use statements makes them clearly visible.

                                  Example

                                  function make() {
                                      return new \stdClass();
                                  }

                                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                                  The method getBranch has a boolean flag argument $refresh, which is a certain sign of a Single Responsibility Principle violation.
                                  Open

                                      public function getBranch($refresh = false)
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  BooleanArgumentFlag

                                  Since: 1.4.0

                                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                                  Example

                                  class Foo {
                                      public function bar($flag = true) {
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                                  Missing class import via use statement (line '1113', column '23').
                                  Open

                                              throw new \Exception("NPM install failed.\nCheck " . $_ENV['TRIM_OUTPUT'] . " for more details.");
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  MissingImport

                                  Since: 2.7.0

                                  Importing all external classes in a file through use statements makes them clearly visible.

                                  Example

                                  function make() {
                                      return new \stdClass();
                                  }

                                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                                  Missing class import via use statement (line '1126', column '23').
                                  Open

                                              throw new \Exception("NPM build failed.\nCheck " . $_ENV['TRIM_OUTPUT'] . " for more details.");
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  MissingImport

                                  Since: 2.7.0

                                  Importing all external classes in a file through use statements makes them clearly visible.

                                  Example

                                  function make() {
                                      return new \stdClass();
                                  }

                                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                                  The method getInstallType has a boolean flag argument $refresh, which is a certain sign of a Single Responsibility Principle violation.
                                  Open

                                      public function getInstallType($refresh = false)
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  BooleanArgumentFlag

                                  Since: 1.4.0

                                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                                  Example

                                  class Foo {
                                      public function bar($flag = true) {
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                                  Missing class import via use statement (line '590', column '23').
                                  Open

                                              throw new \Exception('Access to this instance does not support execution of shell commands.');
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  MissingImport

                                  Since: 2.7.0

                                  Importing all external classes in a file through use statements makes them clearly visible.

                                  Example

                                  function make() {
                                      return new \stdClass();
                                  }

                                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                                  The method clearCache has a boolean flag argument $all, which is a certain sign of a Single Responsibility Principle violation.
                                  Open

                                      public function clearCache($all = false)
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  BooleanArgumentFlag

                                  Since: 1.4.0

                                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                                  Example

                                  class Foo {
                                      public function bar($flag = true) {
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                                  Missing class import via use statement (line '233', column '31').
                                  Open

                                                      throw new \Exception('Command failed');
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  MissingImport

                                  Since: 2.7.0

                                  Importing all external classes in a file through use statements makes them clearly visible.

                                  Example

                                  function make() {
                                      return new \stdClass();
                                  }

                                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                                  Missing class import via use statement (line '594', column '23').
                                  Open

                                              throw new \Exception(sprintf('Patch utility is required to apply local patches.'));
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  MissingImport

                                  Since: 2.7.0

                                  Importing all external classes in a file through use statements makes them clearly visible.

                                  Example

                                  function make() {
                                      return new \stdClass();
                                  }

                                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                                  Missing class import via use statement (line '811', column '23').
                                  Open

                                              throw new \RuntimeException(implode(PHP_EOL, $errors));
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  MissingImport

                                  Since: 2.7.0

                                  Importing all external classes in a file through use statements makes them clearly visible.

                                  Example

                                  function make() {
                                      return new \stdClass();
                                  }

                                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                                  The method getCompatibleVersions has a boolean flag argument $withBlank, which is a certain sign of a Single Responsibility Principle violation.
                                  Open

                                      public function getCompatibleVersions(bool $withBlank = true)
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  BooleanArgumentFlag

                                  Since: 1.4.0

                                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                                  Example

                                  class Foo {
                                      public function bar($flag = true) {
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                                  The method installTikiPackages has a boolean flag argument $update, which is a certain sign of a Single Responsibility Principle violation.
                                  Open

                                      public function installTikiPackages(bool $update = false)
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  BooleanArgumentFlag

                                  Since: 1.4.0

                                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                                  Example

                                  class Foo {
                                      public function bar($flag = true) {
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                                  Missing class import via use statement (line '599', column '23').
                                  Open

                                              throw new \Exception(sprintf('Unable to download patch contents from %s', $patch->url));
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  MissingImport

                                  Since: 2.7.0

                                  Importing all external classes in a file through use statements makes them clearly visible.

                                  Example

                                  function make() {
                                      return new \stdClass();
                                  }

                                  Source http://phpmd.org/rules/cleancode.html#MissingImport

                                  Remove error control operator '@' on line 660.
                                  Open

                                      public function applyPatch(Patch $patch, $options)
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_patch = $access->hasExecutable('patch');
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  ErrorControlOperator

                                  Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

                                  Example

                                  function foo($filePath) {
                                      $file = @fopen($filPath); // hides exceptions
                                      $key = @$array[$notExistingKey]; // assigns null to $key
                                  }

                                  Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

                                  The method getFileChanges has a boolean flag argument $refresh, which is a certain sign of a Single Responsibility Principle violation.
                                  Open

                                      public function getFileChanges($refresh = false)
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  BooleanArgumentFlag

                                  Since: 1.4.0

                                  A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                                  Example

                                  class Foo {
                                      public function bar($flag = true) {
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

                                  The method getBranch uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                  Open

                                          } else {
                                              $branch = '';
                                              while (empty($branch)) {
                                                  $branch = $this->io->ask('No version found. Which tag should be used? (Ex.: (Subversion) branches/1.10) ');
                                              }
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  ElseExpression

                                  Since: 1.4.0

                                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($flag) {
                                              // one branch
                                          } else {
                                              // another branch
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                                  Avoid using static access to class '\TikiManager\Libs\Helpers\ApplicationHelper' in method 'install'.
                                  Open

                                              if (ApplicationHelper::isWindows() && $this->instance->type == 'local') {
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  StaticAccess

                                  Since: 1.4.0

                                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                  Example

                                  class Foo
                                  {
                                      public function bar()
                                      {
                                          Bar::baz();
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                                  The method applyPatch uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                  Open

                                          } else {
                                              $command = $access->createCommand('patch', ['-R', '-p1', '-s', '-f', '--dry-run'], $patch_contents);
                                              $command->run();
                                  
                                              if ($command->getReturn() !== 0) {
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  ElseExpression

                                  Since: 1.4.0

                                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($flag) {
                                              // one branch
                                          } else {
                                              // another branch
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                                  Avoid using static access to class 'TikiManager\Application\Patch' in method 'applyPatches'.
                                  Open

                                          $patches = Patch::getPatches($this->instance->getId());
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  StaticAccess

                                  Since: 1.4.0

                                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                  Example

                                  class Foo
                                  {
                                      public function bar()
                                      {
                                          Bar::baz();
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                                  The method runDatabaseUpdate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                  Open

                                          } else {
                                              $access->runPHP(
                                                  dirname(__FILE__) . '/../../scripts/tiki/sqlupgrade.php',
                                                  [$this->instance->webroot]
                                              );
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  ElseExpression

                                  Since: 1.4.0

                                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($flag) {
                                              // one branch
                                          } else {
                                              // another branch
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                                  The method applyPatch uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                  Open

                                              } else {
                                                  $this->io->writeln("Patch already applied, skipping.");
                                                  $result = false;
                                              }
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  ElseExpression

                                  Since: 1.4.0

                                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($flag) {
                                              // one branch
                                          } else {
                                              // another branch
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                                  The method setupDatabase uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                  Open

                                              } else {
                                                  $access->runPHP(
                                                      dirname(__FILE__) . '/../../scripts/tiki/tiki_dbinstall_ftp.php',
                                                      [$this->instance->webroot]
                                                  );
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  ElseExpression

                                  Since: 1.4.0

                                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($flag) {
                                              // one branch
                                          } else {
                                              // another branch
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                                  The method setupDatabase uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                  Open

                                          } else {
                                              // FIXME: Not FTP compatible ? prior to 3.0 only
                                              $access = $this->instance->getBestAccess('scripting');
                                              $file = $this->instance->getWebPath('db/tiki.sql');
                                              $root = $this->instance->webroot;
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  ElseExpression

                                  Since: 1.4.0

                                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($flag) {
                                              // one branch
                                          } else {
                                              // another branch
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                                  The method restoreDatabase uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                  Open

                                          } else {
                                              $systemConfigFilePath = '';
                                  
                                              if (isset($this->instance->system_config_file)) {
                                                  $srcSystemConfigFilePath = $this->instance->system_config_file;
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  ElseExpression

                                  Since: 1.4.0

                                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($flag) {
                                              // one branch
                                          } else {
                                              // another branch
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                                  The method install uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                  Open

                                          } else {
                                              $access->copyLocalFolder($folder);
                                          }
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  ElseExpression

                                  Since: 1.4.0

                                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($flag) {
                                              // one branch
                                          } else {
                                              // another branch
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                                  Avoid using static access to class '\TikiManager\Libs\Helpers\ApplicationHelper' in method 'backupDatabase'.
                                  Open

                                          if (!$access instanceof ShellPrompt || (ApplicationHelper::isWindows() && $this->instance->type == 'local')) {
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  StaticAccess

                                  Since: 1.4.0

                                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                  Example

                                  class Foo
                                  {
                                      public function bar()
                                      {
                                          Bar::baz();
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                                  The method install uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                  Open

                                              } else {
                                                  $host->rsync([
                                                      'src' => rtrim($folder, '/') . '/',
                                                      'dest' => rtrim($this->instance->webroot, '/') . '/',
                                                      'exclude' => ['.phpenv']
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  ElseExpression

                                  Since: 1.4.0

                                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($flag) {
                                              // one branch
                                          } else {
                                              // another branch
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                                  The method getLocalCheckouts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                  Open

                                                  } else {
                                                      $folders[] = $m[1];
                                                  }
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  ElseExpression

                                  Since: 1.4.0

                                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($flag) {
                                              // one branch
                                          } else {
                                              // another branch
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                                  Avoid assigning values to variables in if clauses and the like (line '649', column '21').
                                  Open

                                      public function applyPatch(Patch $patch, $options)
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_patch = $access->hasExecutable('patch');
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  IfStatementAssignment

                                  Since: 2.7.0

                                  Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($foo = 'bar') { // possible typo
                                              // ...
                                          }
                                          if ($baz = 0) { // always false
                                              // ...
                                          }
                                      }
                                  }

                                  Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                                  The method getBranch uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                  Open

                                              } else {
                                                  return $this->branch = $branch;
                                              }
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  ElseExpression

                                  Since: 1.4.0

                                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($flag) {
                                              // one branch
                                          } else {
                                              // another branch
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                                  Avoid using static access to class '\Symfony\Component\Process\Process' in method 'extractTo'.
                                  Open

                                          $composerCmd = Process::fromShellCommandline("composer install -d $folder/vendor_bundled/ --no-interaction --prefer-dist --no-dev --quiet", null, null, null, 1800);
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  StaticAccess

                                  Since: 1.4.0

                                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                  Example

                                  class Foo
                                  {
                                      public function bar()
                                      {
                                          Bar::baz();
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                                  Avoid using static access to class '\TikiManager\Libs\Helpers\ApplicationHelper' in method 'fixPermissions'.
                                  Open

                                                  if ($instance->type == 'local' && ApplicationHelper::isWindows()) {
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  StaticAccess

                                  Since: 1.4.0

                                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                  Example

                                  class Foo
                                  {
                                      public function bar()
                                      {
                                          Bar::baz();
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                                  The method applyPatch uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                  Open

                                              } else {
                                                  $access->chdir($this->instance->getWebPath('vendor_bundled/vendor/'.$patch->package));
                                              }
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  ElseExpression

                                  Since: 1.4.0

                                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($flag) {
                                              // one branch
                                          } else {
                                              // another branch
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                                  The method extractTo uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                  Open

                                          } else {
                                              $this->io->writeln('Cloning cache repository from server... <fg=yellow>[may take a while]</>');
                                              $this->vcs_instance->clone($version->branch, $folder);
                                          }
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  ElseExpression

                                  Since: 1.4.0

                                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($flag) {
                                              // one branch
                                          } else {
                                              // another branch
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                                  The method fixPermissions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                  Open

                                                  } else {
                                                      $extraParameters = ['-n']; //by default detect the current user and do not ask
                                  
                                                      // detect (guess) if we should pass a given user to the command, normally when running as root
                                                      if ($access->user == 'root' && preg_match('/\/home\/([^\/]+)\/.*/', $instance->webroot, $matches)) {
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  ElseExpression

                                  Since: 1.4.0

                                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($flag) {
                                              // one branch
                                          } else {
                                              // another branch
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                                  Avoid assigning values to variables in if clauses and the like (line '646', column '21').
                                  Open

                                      public function applyPatch(Patch $patch, $options)
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_patch = $access->hasExecutable('patch');
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  IfStatementAssignment

                                  Since: 2.7.0

                                  Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($foo = 'bar') { // possible typo
                                              // ...
                                          }
                                          if ($baz = 0) { // always false
                                              // ...
                                          }
                                      }
                                  }

                                  Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                                  The method fixPermissions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                  Open

                                              } else {
                                                  $this->io->warning('Old Tiki detected, running bundled Tiki Manager setup.sh script.');
                                                  $filename = $instance->getWorkPath('setup.sh');
                                                  $access->uploadFile(dirname(__FILE__) . '/../../scripts/setup.sh', $filename);
                                                  $command = $access->createCommand('bash', ['$filename']); // does composer as well
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  ElseExpression

                                  Since: 1.4.0

                                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($flag) {
                                              // one branch
                                          } else {
                                              // another branch
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                                  The method applyPatch uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                  Open

                                          } else {
                                              // For packages installed via Tiki Package Manager
                                              $folder = 'vendor/';
                                              if (substr($patch->package, 0, strlen($folder)) === $folder) {
                                                  $access->chdir($this->instance->getWebPath($patch->package));
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  ElseExpression

                                  Since: 1.4.0

                                  An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                  Example

                                  class Foo
                                  {
                                      public function bar($flag)
                                      {
                                          if ($flag) {
                                              // one branch
                                          } else {
                                              // another branch
                                          }
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#elseexpression

                                  Avoid using static access to class '\TikiManager\Libs\Helpers\ApplicationHelper' in method 'installComposerDependencies'.
                                  Open

                                          if ($instance->type == 'local' && ApplicationHelper::isWindows()) {
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  StaticAccess

                                  Since: 1.4.0

                                  Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

                                  Example

                                  class Foo
                                  {
                                      public function bar()
                                      {
                                          Bar::baz();
                                      }
                                  }

                                  Source https://phpmd.org/rules/cleancode.html#staticaccess

                                  Avoid unused local variables such as '$escaped_root_path'.
                                  Open

                                              $escaped_root_path = escapeshellarg(rtrim($this->instance->webroot, '/\\'));
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  UnusedLocalVariable

                                  Since: 0.2

                                  Detects when a local variable is declared and/or assigned, but not used.

                                  Example

                                  class Foo {
                                      public function doSomething()
                                      {
                                          $i = 5; // Unused
                                      }
                                  }

                                  Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

                                  Avoid unused local variables such as '$vcsType'.
                                  Open

                                          $vcsType = $this->vcs_instance->getIdentifier();
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  UnusedLocalVariable

                                  Since: 0.2

                                  Detects when a local variable is declared and/or assigned, but not used.

                                  Example

                                  class Foo {
                                      public function doSomething()
                                      {
                                          $i = 5; // Unused
                                      }
                                  }

                                  Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

                                  FIXME found
                                  Open

                                          // FIXME: Not FTP compatible (arguments)
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by fixme

                                  TODO found
                                  Open

                                                      // TODO Requires implementation
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by fixme

                                  TODO found
                                  Open

                                              // TODO: Hard-coding: 'apache:apache'
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by fixme

                                  TODO found
                                  Open

                                              // TODO: File ownership under the webroot should be configurable per instance.
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by fixme

                                  Returning type void but installComposerDependencies() is declared to return null
                                  Open

                                              return;
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phan

                                  Argument 1 (str) is int but \trim() takes string
                                  Open

                                          if (strlen(trim($commit_id))>0) {
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phan

                                  FIXME found
                                  Open

                                              // FIXME: Not FTP compatible ? prior to 3.0 only
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by fixme

                                  FIXME found
                                  Open

                                          // FIXME: Not FTP compatible
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by fixme

                                  The property $vcs_instance is not named in camelCase.
                                  Open

                                  class Tiki extends Application
                                  {
                                      private $installType = null;
                                      private $branch = null;
                                      private $installed = null;
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCasePropertyName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name attributes.

                                  Example

                                  class ClassName {
                                      protected $property_name;
                                  }

                                  Source

                                  The variable $patch_contents is not named in camelCase.
                                  Open

                                      public function applyPatch(Patch $patch, $options)
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_patch = $access->hasExecutable('patch');
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $date_revision is not named in camelCase.
                                  Open

                                      public function getDateRevision($folder = null)
                                      {
                                          $date_revision = '';
                                          $commit_id = $this->getRevision($folder);
                                  
                                  
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $date_revision is not named in camelCase.
                                  Open

                                      public function getDateRevision($folder = null)
                                      {
                                          $date_revision = '';
                                          $commit_id = $this->getRevision($folder);
                                  
                                  
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_svn is not named in camelCase.
                                  Open

                                      public function performActualUpdate(Version $version, $options = [])
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_svn = $access->hasExecutable('svn') && $vcsType == 'SVN';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_svn is not named in camelCase.
                                  Open

                                      public function getRevision($folder = null)
                                      {
                                          $revision = '';
                                          $access = $this->instance->getBestAccess('scripting');
                                          $can_svn = $access->hasExecutable('svn') && $this->vcs_instance->getIdentifier() == 'SVN';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $commit_id is not named in camelCase.
                                  Open

                                      public function getDateRevision($folder = null)
                                      {
                                          $date_revision = '';
                                          $commit_id = $this->getRevision($folder);
                                  
                                  
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_svn is not named in camelCase.
                                  Open

                                      public function getDateRevision($folder = null)
                                      {
                                          $date_revision = '';
                                          $commit_id = $this->getRevision($folder);
                                  
                                  
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $commit_id is not named in camelCase.
                                  Open

                                      public function getDateRevision($folder = null)
                                      {
                                          $date_revision = '';
                                          $commit_id = $this->getRevision($folder);
                                  
                                  
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_patch is not named in camelCase.
                                  Open

                                      public function applyPatch(Patch $patch, $options)
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_patch = $access->hasExecutable('patch');
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $escaped_root_path is not named in camelCase.
                                  Open

                                      public function performActualUpdate(Version $version, $options = [])
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_svn = $access->hasExecutable('svn') && $vcsType == 'SVN';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $escaped_temp_path is not named in camelCase.
                                  Open

                                      public function performActualUpdate(Version $version, $options = [])
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_svn = $access->hasExecutable('svn') && $vcsType == 'SVN';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $date_revision is not named in camelCase.
                                  Open

                                      public function getDateRevision($folder = null)
                                      {
                                          $date_revision = '';
                                          $commit_id = $this->getRevision($folder);
                                  
                                  
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $patch_contents is not named in camelCase.
                                  Open

                                      public function applyPatch(Patch $patch, $options)
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_patch = $access->hasExecutable('patch');
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $commit_id is not named in camelCase.
                                  Open

                                      public function getDateRevision($folder = null)
                                      {
                                          $date_revision = '';
                                          $commit_id = $this->getRevision($folder);
                                  
                                  
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_git is not named in camelCase.
                                  Open

                                      public function performActualUpgrade(Version $version, $options = [])
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $can_svn = $access->hasExecutable('svn') && $this->vcs_instance->getIdentifier() == 'SVN';
                                          $can_git = $access->hasExecutable('git') && $this->vcs_instance->getIdentifier() == 'GIT';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_svn is not named in camelCase.
                                  Open

                                      public function getRevision($folder = null)
                                      {
                                          $revision = '';
                                          $access = $this->instance->getBestAccess('scripting');
                                          $can_svn = $access->hasExecutable('svn') && $this->vcs_instance->getIdentifier() == 'SVN';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_svn is not named in camelCase.
                                  Open

                                      public function getDateRevision($folder = null)
                                      {
                                          $date_revision = '';
                                          $commit_id = $this->getRevision($folder);
                                  
                                  
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $patch_contents is not named in camelCase.
                                  Open

                                      public function applyPatch(Patch $patch, $options)
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_patch = $access->hasExecutable('patch');
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $patch_contents is not named in camelCase.
                                  Open

                                      public function applyPatch(Patch $patch, $options)
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_patch = $access->hasExecutable('patch');
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_git is not named in camelCase.
                                  Open

                                      public function performActualUpdate(Version $version, $options = [])
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_svn = $access->hasExecutable('svn') && $vcsType == 'SVN';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $escaped_cache_path is not named in camelCase.
                                  Open

                                      public function performActualUpdate(Version $version, $options = [])
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_svn = $access->hasExecutable('svn') && $vcsType == 'SVN';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $escaped_cache_path is not named in camelCase.
                                  Open

                                      public function performActualUpdate(Version $version, $options = [])
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_svn = $access->hasExecutable('svn') && $vcsType == 'SVN';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_patch is not named in camelCase.
                                  Open

                                      public function applyPatch(Patch $patch, $options)
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_patch = $access->hasExecutable('patch');
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_git is not named in camelCase.
                                  Open

                                      public function performActualUpgrade(Version $version, $options = [])
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $can_svn = $access->hasExecutable('svn') && $this->vcs_instance->getIdentifier() == 'SVN';
                                          $can_git = $access->hasExecutable('git') && $this->vcs_instance->getIdentifier() == 'GIT';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_git is not named in camelCase.
                                  Open

                                      public function getDateRevision($folder = null)
                                      {
                                          $date_revision = '';
                                          $commit_id = $this->getRevision($folder);
                                  
                                  
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_svn is not named in camelCase.
                                  Open

                                      public function performActualUpgrade(Version $version, $options = [])
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $can_svn = $access->hasExecutable('svn') && $this->vcs_instance->getIdentifier() == 'SVN';
                                          $can_git = $access->hasExecutable('git') && $this->vcs_instance->getIdentifier() == 'GIT';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_git is not named in camelCase.
                                  Open

                                      public function getRevision($folder = null)
                                      {
                                          $revision = '';
                                          $access = $this->instance->getBestAccess('scripting');
                                          $can_svn = $access->hasExecutable('svn') && $this->vcs_instance->getIdentifier() == 'SVN';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_git is not named in camelCase.
                                  Open

                                      public function getRevision($folder = null)
                                      {
                                          $revision = '';
                                          $access = $this->instance->getBestAccess('scripting');
                                          $can_svn = $access->hasExecutable('svn') && $this->vcs_instance->getIdentifier() == 'SVN';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_git is not named in camelCase.
                                  Open

                                      public function getDateRevision($folder = null)
                                      {
                                          $date_revision = '';
                                          $commit_id = $this->getRevision($folder);
                                  
                                  
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $escaped_temp_path is not named in camelCase.
                                  Open

                                      public function performActualUpdate(Version $version, $options = [])
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_svn = $access->hasExecutable('svn') && $vcsType == 'SVN';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $patch_contents is not named in camelCase.
                                  Open

                                      public function applyPatch(Patch $patch, $options)
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_patch = $access->hasExecutable('patch');
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_svn is not named in camelCase.
                                  Open

                                      public function performActualUpdate(Version $version, $options = [])
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_svn = $access->hasExecutable('svn') && $vcsType == 'SVN';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_svn is not named in camelCase.
                                  Open

                                      public function performActualUpgrade(Version $version, $options = [])
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $can_svn = $access->hasExecutable('svn') && $this->vcs_instance->getIdentifier() == 'SVN';
                                          $can_git = $access->hasExecutable('git') && $this->vcs_instance->getIdentifier() == 'GIT';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $can_git is not named in camelCase.
                                  Open

                                      public function performActualUpdate(Version $version, $options = [])
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_svn = $access->hasExecutable('svn') && $vcsType == 'SVN';
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $patch_contents is not named in camelCase.
                                  Open

                                      public function applyPatch(Patch $patch, $options)
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_patch = $access->hasExecutable('patch');
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  The variable $patch_contents is not named in camelCase.
                                  Open

                                      public function applyPatch(Patch $patch, $options)
                                      {
                                          $access = $this->instance->getBestAccess('scripting');
                                          $vcsType = $this->vcs_instance->getIdentifier();
                                          $can_patch = $access->hasExecutable('patch');
                                  Severity: Minor
                                  Found in src/Application/Tiki.php by phpmd

                                  CamelCaseVariableName

                                  Since: 0.2

                                  It is considered best practice to use the camelCase notation to name variables.

                                  Example

                                  class ClassName {
                                      public function doSomething() {
                                          $data_module = new DataModule();
                                      }
                                  }

                                  Source

                                  There are no issues that match your filters.

                                  Category
                                  Status