TikiWiki/tiki-manager

View on GitHub

Showing 2,235 of 2,235 total issues

rsync accesses the super-global variable $_ENV.
Open

    public function rsync($args = [])
    {
        $return_val = -1;
        if (empty($args['src']) || empty($args['dest'])) {
            return $return_val;
Severity: Minor
Found in src/Libs/Host/SSH.php 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($host, $user, $port)
    {
        $this->host = $host;
        $this->user = $user;
        $this->port = $port ?: 22;
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

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

setInstanceSetupError accesses the super-global variable $_ENV.
Open

    public static function setInstanceSetupError($instanceId, \Exception $e = null, $action = 'install')
    {
        $errors = [];
        $io = App::get('io');

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

runCommands accesses the super-global variable $_ENV.
Open

    public function runCommands($commands, $output = false)
    {
        if (!is_array($commands)) {
            $commands = func_get_args();
        }
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

mergeWithExistingEnvironmentVariables accesses the super-global variable $_ENV.
Open

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

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

getExtHandle accesses the super-global variable $_ENV.
Open

    private function getExtHandle()
    {
        $host = $this->host;
        $user = $this->user;
        $port = $this->port;
Severity: Minor
Found in src/Libs/Host/SSHSeclibAdapter.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 rsync() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
Open

    public function rsync($args = [])
    {
        $return_val = -1;
        if (empty($args['src']) || empty($args['dest'])) {
            return $return_val;
Severity: Minor
Found in src/Libs/Host/SSH.php 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

displayInfo accesses the super-global variable $_ENV.
Open

    public static function displayInfo(Discovery $discovery)
    {
        $io = App::get('io');
        $io->writeln('<info>Running on ' . $discovery->detectDistro() . '</info>');
        $io->writeln('<info>PHP Version: ' . phpversion() . '</info>');
Severity: Minor
Found in src/Command/Helper/CommandHelper.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 execute() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (empty($this->instancesInfo)) {
            $output->writeln('<comment>No instances available to detect.</comment>');
            return;
Severity: Minor
Found in src/Command/DetectInstanceCommand.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 execute() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $instances = CommandHelper::getInstances();
        $instancesInfo = CommandHelper::getInstancesInfo($instances);

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

runCommand accesses the super-global variable $_ENV.
Open

    public function runCommand($command, $options = [])
    {
        $cwd = !empty($options['cwd']) ? $options['cwd'] : $this->location;
        $env = !empty($options['env']) ? $options['env'] : $this->env;

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

__construct accesses the super-global variable $_ENV.
Open

    public function __construct()
    {
        $_ENV['HTTP_ACCEPT_ENCODING'] = '';
        $this->env = $_ENV ?: [];
        $this->io = App::get('io');
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

__construct accesses the super-global variable $_ENV.
Open

    public function __construct()
    {
        $_ENV['HTTP_ACCEPT_ENCODING'] = '';
        $this->env = $_ENV ?: [];
        $this->io = App::get('io');
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

mergeWithExistingEnvironmentVariables accesses the super-global variable $_SERVER.
Open

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

        // getenv will only return all env variables starting 7.1.0
Severity: Minor
Found in src/Libs/Host/Local.php 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 = '')
    {
        $key = $_ENV['SSH_KEY'];
        $port = null;
        if ($this->port != 22) {
Severity: Minor
Found in src/Libs/Host/SSH.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($host, $user, $port)
    {
        $this->host = $host;
        $this->user = $user;
        $this->port = $port ?: 22;
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

getVersionControlSystem accesses the super-global variable $_ENV.
Open

    public static function getVersionControlSystem(Instance $instance)
    {
        $type = $instance->vcs_type ?? $_ENV['DEFAULT_VCS'];
        $vcsInstance = null;

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