TikiWiki/tiki-manager

View on GitHub

Showing 2,235 of 2,235 total issues

loadEnvironmentVariablesContainingLogic accesses the super-global variable $_ENV.
Open

    private function loadEnvironmentVariablesContainingLogic()
    {
        $_ENV['TRIM_OS'] = strtoupper(substr(PHP_OS, 0, 3));

        if ($_ENV['TRIM_OS'] === 'WIN') {
Severity: Minor
Found in src/Config/Environment.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

loadEnvironmentVariablesContainingLogic accesses the super-global variable $_ENV.
Open

    private function loadEnvironmentVariablesContainingLogic()
    {
        $_ENV['TRIM_OS'] = strtoupper(substr(PHP_OS, 0, 3));

        if ($_ENV['TRIM_OS'] === 'WIN') {
Severity: Minor
Found in src/Config/Environment.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

runSetup accesses the super-global variable $_ENV.
Open

    private function runSetup()
    {
        debug('Running Tiki Manager at ' . $_ENV['TRIM_ROOT']);

        $writableFolders = ['CACHE_FOLDER', 'TEMP_FOLDER', 'RSYNC_FOLDER', 'MOUNT_FOLDER', 'BACKUP_FOLDER', 'ARCHIVE_FOLDER', 'TRIM_LOGS', 'TRIM_DATA', 'TRIM_SRC_FOLDER'];
Severity: Minor
Found in src/Config/Environment.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

runSetup accesses the super-global variable $_ENV.
Open

    private function runSetup()
    {
        debug('Running Tiki Manager at ' . $_ENV['TRIM_ROOT']);

        $writableFolders = ['CACHE_FOLDER', 'TEMP_FOLDER', 'RSYNC_FOLDER', 'MOUNT_FOLDER', 'BACKUP_FOLDER', 'ARCHIVE_FOLDER', 'TRIM_LOGS', 'TRIM_DATA', 'TRIM_SRC_FOLDER'];
Severity: Minor
Found in src/Config/Environment.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 10. The configured cyclomatic complexity threshold is 10.
Open

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $checksumCheck = $input->getOption('check') ?? false;
        $instancesOption = $input->getOption('instances');
        $instances = CommandHelper::getInstances('update');

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

    private function loadEnvironmentVariablesContainingLogic()
    {
        $_ENV['TRIM_OS'] = strtoupper(substr(PHP_OS, 0, 3));

        if ($_ENV['TRIM_OS'] === 'WIN') {
Severity: Minor
Found in src/Config/Environment.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

loadEnvironmentVariablesContainingLogic accesses the super-global variable $_ENV.
Open

    private function loadEnvironmentVariablesContainingLogic()
    {
        $_ENV['TRIM_OS'] = strtoupper(substr(PHP_OS, 0, 3));

        if ($_ENV['TRIM_OS'] === 'WIN') {
Severity: Minor
Found in src/Config/Environment.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

runSetup accesses the super-global variable $_ENV.
Open

    private function runSetup()
    {
        debug('Running Tiki Manager at ' . $_ENV['TRIM_ROOT']);

        $writableFolders = ['CACHE_FOLDER', 'TEMP_FOLDER', 'RSYNC_FOLDER', 'MOUNT_FOLDER', 'BACKUP_FOLDER', 'ARCHIVE_FOLDER', 'TRIM_LOGS', 'TRIM_DATA', 'TRIM_SRC_FOLDER'];
Severity: Minor
Found in src/Config/Environment.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 arrayFlatten() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
Open

    public static function arrayFlatten($array, $objectFlat = false)
    {
        $result = [];
        $visited = [];
        $queue = [];

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 cleanup() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
Open

    public static function cleanup($instanceId, $instanceName, $maxBackups = 0)
    {
        $backup_directory = "{$instanceId}-{$instanceName}";

        $files = glob($_ENV['ARCHIVE_FOLDER'] . "/$backup_directory" . '/*.tar.bz2');
Severity: Minor
Found in src/Libs/Helpers/Archive.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

cleanup accesses the super-global variable $_ENV.
Open

    public static function cleanup($instanceId, $instanceName, $maxBackups = 0)
    {
        $backup_directory = "{$instanceId}-{$instanceName}";

        $files = glob($_ENV['ARCHIVE_FOLDER'] . "/$backup_directory" . '/*.tar.bz2');
Severity: Minor
Found in src/Libs/Helpers/Archive.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

loadEnvironmentVariablesContainingLogic accesses the super-global variable $_ENV.
Open

    private function loadEnvironmentVariablesContainingLogic()
    {
        $_ENV['TRIM_OS'] = strtoupper(substr(PHP_OS, 0, 3));

        if ($_ENV['TRIM_OS'] === 'WIN') {
Severity: Minor
Found in src/Config/Environment.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

runSetup accesses the super-global variable $_ENV.
Open

    private function runSetup()
    {
        debug('Running Tiki Manager at ' . $_ENV['TRIM_ROOT']);

        $writableFolders = ['CACHE_FOLDER', 'TEMP_FOLDER', 'RSYNC_FOLDER', 'MOUNT_FOLDER', 'BACKUP_FOLDER', 'ARCHIVE_FOLDER', 'TRIM_LOGS', 'TRIM_DATA', 'TRIM_SRC_FOLDER'];
Severity: Minor
Found in src/Config/Environment.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

getEnvironmentVariables accesses the super-global variable $_ENV.
Open

    protected function getEnvironmentVariables()
    {
        return array_merge($_ENV, $_SERVER);
    }
Severity: Minor
Found in src/Config/Environment.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

    public function execute($type): void
    {
        $scripts = $this->getScripts($type);

        if (empty($scripts)) {
Severity: Minor
Found in src/Hooks/TikiCommandHook.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 createFromLogin() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
Open

    public static function createFromLogin($login, $type, $key = 0)
    {
        switch ($type) {
            case 'reverse':
                return strrev($login);
Severity: Minor
Found in src/Ext/Password.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

cleanup accesses the super-global variable $_ENV.
Open

    public static function cleanup($instanceId, $instanceName, $maxBackups = 0)
    {
        $backup_directory = "{$instanceId}-{$instanceName}";

        $files = glob($_ENV['ARCHIVE_FOLDER'] . "/$backup_directory" . '/*.tar.bz2');
Severity: Minor
Found in src/Libs/Helpers/Archive.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 handleCheckResult() has a Cyclomatic Complexity of 39. The configured cyclomatic complexity threshold is 10.
Open

    public static function handleCheckResult(Instance $instance, Version $version, $array)
    {
        if (! $_ENV['INTERACTIVE']) {
            return; // skip
        }
Severity: Minor
Found in src/Libs/Helpers/Checksum.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

loadEnvironmentVariablesContainingLogic accesses the super-global variable $_ENV.
Open

    private function loadEnvironmentVariablesContainingLogic()
    {
        $_ENV['TRIM_OS'] = strtoupper(substr(PHP_OS, 0, 3));

        if ($_ENV['TRIM_OS'] === 'WIN') {
Severity: Minor
Found in src/Config/Environment.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

loadEnvironmentVariablesContainingLogic accesses the super-global variable $_ENV.
Open

    private function loadEnvironmentVariablesContainingLogic()
    {
        $_ENV['TRIM_OS'] = strtoupper(substr(PHP_OS, 0, 3));

        if ($_ENV['TRIM_OS'] === 'WIN') {
Severity: Minor
Found in src/Config/Environment.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