TikiWiki/tiki-manager

View on GitHub

Showing 2,238 of 2,238 total issues

Avoid using static access to class 'TikiManager\Libs\Requirements\Requirements' in method 'detectComposer'.
Open

    $requirementsInstance = TikiManager\Libs\Requirements\Requirements::getInstance();
Severity: Minor
Found in src/Libs/Helpers/functions.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 prepareArgs uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $arg = escapeshellarg($arg);
                }
Severity: Minor
Found in src/Libs/Host/Command.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 readManifest uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $source = $archiveFolder . DIRECTORY_SEPARATOR . $hash;
                $source .= $type != 'conf_external' ? DIRECTORY_SEPARATOR . basename($destination) : '';
            }
Severity: Minor
Found in src/Application/Restore.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 readManifest 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("Skipping {$destination}. Path shouldn't have absolute paths, to avoid override data. You can use --allow-common-parent-levels if you want to allow restore from sibling folders");
                        continue;
                    }
Severity: Minor
Found in src/Application/Restore.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\Yaml\Yaml' in method 'getParsedRequirements'.
Open

        return Yaml::parseFile($this->requirementsFile);

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 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 using static access to class 'TikiManager\Application\Instance' in method 'getInstance'.
Open

        return Instance::getInstance($this->instance);
Severity: Minor
Found in src/Application/Version.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\Audit\Checksum' in method 'collectChecksumFromInstance'.
Open

        return Checksum::saveChecksums($this->id, $result);
Severity: Minor
Found in src/Application/Version.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 execute uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $output->writeln('<fg=cyan>Connecting to ' . $instance->name . ' at ' . $instance->webroot . ' directory... (use "exit" to move to next the instance)</>');
                    $access->openShell($instance->webroot);
                }
Severity: Minor
Found in src/Command/AccessInstanceCommand.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 '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

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

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

        } else {
            if (! empty($branch)) {
                // If we get here then is a non-numeric version, we will assume is similar to master.
                $result = 'master';
            }
Severity: Minor
Found in src/Application/Version.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\Audit\Checksum' in method 'performCheck'.
Open

            : (Checksum::checksumRemoteFolder($folder, $access));
Severity: Minor
Found in src/Application/Version.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\Audit\Checksum' in method 'collectChecksumFromInstance'.
Open

            ? (Checksum::checksumLocalFolder($folder))
Severity: Minor
Found in src/Application/Version.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\Audit\Checksum' in method 'removeFile'.
Open

        return Checksum::removeFile($this->id, $filename);
Severity: Minor
Found in src/Application/Version.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\Audit\Checksum' in method 'getFileMap'.
Open

        return Checksum::getChecksums($this->id);
Severity: Minor
Found in src/Application/Version.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 '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

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

Avoid using static access to class '\TikiManager\Command\Helper\CommandHelper' in method 'execute'.
Open

                $question = CommandHelper::getQuestion('Which instance(s) do you want to access', null, '?');
Severity: Minor
Found in src/Command/AccessInstanceCommand.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

Severity
Category
Status
Source
Language