TikiWiki/tiki-manager

View on GitHub

Showing 2,235 of 2,235 total issues

setSafeDirectory accesses the super-global variable $_ENV.
Open

    private function setSafeDirectory($instance)
    {
        $skipSafeDir = isset($_ENV['GIT_DONT_ADD_SAFEDIR']) ? (bool) $_ENV['GIT_DONT_ADD_SAFEDIR'] : false;

        if ($skipSafeDir) {
Severity: Minor
Found in src/Libs/VersionControl/Git.php 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

__construct accesses the super-global variable $_ENV.
Open

    public function __construct(Instance $instance, array $vcsOptions = [], LoggerInterface $logger = null)
    {
        parent::__construct($instance, $vcsOptions, $logger);
        $this->setRepositoryUrl($_ENV['GIT_TIKIWIKI_URI'] ?? self::DEFAULT_GIT_REPOSITORY);
        $this->setSafeDirectory($instance);
Severity: Minor
Found in src/Libs/VersionControl/Git.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

getRepositoryUrl accesses the super-global variable $_ENV.
Open

    protected function getRepositoryUrl()
    {
        return $_ENV['SVN_TIKIWIKI_URI'];
    }
Severity: Minor
Found in src/Libs/VersionControl/Svn.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

getCommandPrefix accesses the super-global variable $_ENV.
Open

    private function getCommandPrefix($options = [])
    {
        $options['-i'] = !empty($options['pubkey']) ? $options['pubkey'] : $_ENV['SSH_KEY'];
        $options['-F'] = !empty($options['config']) ? $options['config'] : $_ENV['SSH_CONFIG'];
        $options['-p'] = !empty($options['port']) ? $options['port'] : $this->port;
Severity: Minor
Found in src/Libs/Host/SSHWrapperAdapter.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

setSafeDirectory accesses the super-global variable $_ENV.
Open

    private function setSafeDirectory($instance)
    {
        $skipSafeDir = isset($_ENV['GIT_DONT_ADD_SAFEDIR']) ? (bool) $_ENV['GIT_DONT_ADD_SAFEDIR'] : false;

        if ($skipSafeDir) {
Severity: Minor
Found in src/Libs/VersionControl/Git.php 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

__construct accesses the super-global variable $_ENV.
Open

    public function __construct(Instance $instance, array $vcsOptions = [], LoggerInterface $logger = null)
    {
        parent::__construct($instance, $vcsOptions, $logger);
        $this->command = 'svn';
        $this->repositoryUrl = $_ENV['SVN_TIKIWIKI_URI'];
Severity: Minor
Found in src/Libs/VersionControl/Svn.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

getCommandPrefix accesses the super-global variable $_ENV.
Open

    private function getCommandPrefix($options = [])
    {
        $options['-i'] = !empty($options['pubkey']) ? $options['pubkey'] : $_ENV['SSH_KEY'];
        $options['-F'] = !empty($options['config']) ? $options['config'] : $_ENV['SSH_CONFIG'];
        $options['-p'] = !empty($options['port']) ? $options['port'] : $this->port;
Severity: Minor
Found in src/Libs/Host/SSHWrapperAdapter.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

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

    public function getAvailableBranches()
    {
        $versions = [];

        foreach (explode("\n", `git ls-remote --heads --tags --refs $this->repositoryUrl`) as $line) {
Severity: Minor
Found in src/Libs/VersionControl/Git.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

getDiskUsage accesses the super-global variable $_ENV.
Open

    private function getDiskUsage(&$used, &$total, &$available)
    {
        $path = escapeshellarg($_ENV['ARCHIVE_FOLDER']);
        $out = `df $path | awk '/^\// {print $3,$2,$4}'`;

Severity: Minor
Found in src/Report/Backup.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

Avoid using TikiManager\Report\count() function in while loops.
Open

        while ($value >= 1000 && count($unit) > 0) {
            $value /= 1024;
            $used = array_shift($unit);
        }
Severity: Minor
Found in src/Report/Backup.php by phpmd

CountInLoopExpression

Since: 2.7.0

Using count/sizeof in loops expressions is considered bad practice and is a potential source of many bugs, especially when the loop manipulates an array, as count happens on each iteration.

Example

class Foo {

  public function bar()
  {
    $array = array();

    for ($i = 0; count($array); $i++) {
      // ...
    }
  }
}

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

updateInstanceTo accesses the super-global variable $_ENV.
Open

    public function updateInstanceTo($path, $branch)
    {
        $info = $this->info($path);
        $root = $info['repository']['root'];
        $url = $info['url'];
Severity: Minor
Found in src/Repository/SVN.php 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

update accesses the super-global variable $_ENV.
Open

    public function update(string $targetFolder, string $branch, int $lag = 0)
    {
        if (preg_match('/(\d+)\.(\d+).*/', $branch, $matches1)) {
            $version = $matches1[0];
            $cacheFolder = $_ENV['CACHE_FOLDER'] . DIRECTORY_SEPARATOR . 'tiki-src-' . $version;
Severity: Minor
Found in src/Libs/VersionControl/Src.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

findFileForBranch accesses the super-global variable $_ENV.
Open

    public function findFileForBranch($branchName): array
    {
        //find file for branch name
        return array_values(array_filter(scandir($_ENV['TRIM_SRC_FOLDER']), function ($file) use ($branchName) {
            preg_match(Src::$pattern, $file, $matches);
Severity: Minor
Found in src/Libs/VersionControl/Src.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

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

    private function setSafeDirectory($instance)
    {
        $skipSafeDir = isset($_ENV['GIT_DONT_ADD_SAFEDIR']) ? (bool) $_ENV['GIT_DONT_ADD_SAFEDIR'] : false;

        if ($skipSafeDir) {
Severity: Minor
Found in src/Libs/VersionControl/Git.php 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

setSafeDirectory accesses the super-global variable $_SERVER.
Open

    private function setSafeDirectory($instance)
    {
        $skipSafeDir = isset($_ENV['GIT_DONT_ADD_SAFEDIR']) ? (bool) $_ENV['GIT_DONT_ADD_SAFEDIR'] : false;

        if ($skipSafeDir) {
Severity: Minor
Found in src/Libs/VersionControl/Git.php 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

getAvailableVersions accesses the super-global variable $_ENV.
Open

    private function getAvailableVersions()
    {
        $versions = array_values(array_filter(array_map(function ($file) {
            preg_match(Src::$pattern, $file, $matches);
            return (count($matches) == 3) ? trim($matches[1]) : null;
Severity: Minor
Found in src/Libs/VersionControl/Src.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

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

    public function getAvailableBranches()
    {
        $versions = [];
        $versionsTemp = [];

Severity: Minor
Found in src/Libs/VersionControl/Svn.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

execute accesses the super-global variable $_ENV.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('<comment>WARNING!</comment>');
        $output->writeln('<comment>You are about to delete all state, backup, cache, and log files!</comment>');

Severity: Minor
Found in src/Command/ResetManagerCommand.php 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

execute accesses the super-global variable $_ENV.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('<comment>WARNING!</comment>');
        $output->writeln('<comment>You are about to delete all state, backup, cache, and log files!</comment>');

Severity: Minor
Found in src/Command/ResetManagerCommand.php 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

openShell accesses the super-global variable $_ENV.
Open

    public function openShell($workingDir = '')
    {

        if (empty($workingDir)) {
            return;
Severity: Minor
Found in src/Libs/Host/Local.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

Severity
Category
Status
Source
Language