TikiWiki/tiki-manager

View on GitHub

Showing 2,238 of 2,238 total issues

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

        $result = $this->query($sql);
Severity: Minor
Found in src/Libs/Database/Database.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

                CommandHelper::renderInstancesTable($output, $instancesInfo);
Severity: Minor
Found in src/Command/VerifyInstanceCommand.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 rotx uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $tmp .= $login[$i];
            }
Severity: Minor
Found in src/Ext/Password.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 private methods such as 'asciiRotxpp'.
Open

    private static function asciiRotxpp($login, $key)
    {
        $tmp = '';

        for ($i = 0, $tmp_count = strlen($login); $i < $tmp_count; $i++, $key++) {
Severity: Minor
Found in src/Ext/Password.php by phpmd

UnusedPrivateMethod

Since: 0.2

Unused Private Method detects when a private method is declared but is unused.

Example

class Something
{
    private function foo() {} // unused
}

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

Avoid unused private methods such as 'shuffle'.
Open

    private static function shuffle($login)
    {
        $tmp = [];

        for ($i = 0, $tmp_count = strlen($login); $i < $tmp_count; $i++) {
Severity: Minor
Found in src/Ext/Password.php by phpmd

UnusedPrivateMethod

Since: 0.2

Unused Private Method detects when a private method is declared but is unused.

Example

class Something
{
    private function foo() {} // unused
}

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

Avoid unused private methods such as 'createUnpronounceable'.
Open

    private static function createUnpronounceable($length, $chars)
    {
        global $_Text_Password_NumberOfPossibleCharacters;

        $password = '';
Severity: Minor
Found in src/Ext/Password.php by phpmd

UnusedPrivateMethod

Since: 0.2

Unused Private Method detects when a private method is declared but is unused.

Example

class Something
{
    private function foo() {} // unused
}

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

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

                'user' => $user_tiki ?? '',
Severity: Minor
Found in src/Libs/Database/Database.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 '$pass_tiki'.
Open

                'pass' => $pass_tiki ?? '',
Severity: Minor
Found in src/Libs/Database/Database.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 '$visited'.
Open

        $visited = [];

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 arrayFlatten uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $result[] = $value;
                }

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 cleanup uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                break;
            }
Severity: Minor
Found in src/Libs/Helpers/Archive.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 '$file'.
Open

            $file = $_ENV['DB_FILE'];
Severity: Minor
Found in src/Config/Environment.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\Ext\Password' in method 'createFromLogin'.
Open

                return Password::xor($login, $key);
Severity: Minor
Found in src/Ext/Password.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\Ext\Password' in method 'createFromLogin'.
Open

                return Password::rotx($login, $key);
Severity: Minor
Found in src/Ext/Password.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 private methods such as 'rotx'.
Open

    private static function rotx($login, $key)
    {
        $tmp = '';
        $login = strtolower($login);

Severity: Minor
Found in src/Ext/Password.php by phpmd

UnusedPrivateMethod

Since: 0.2

Unused Private Method detects when a private method is declared but is unused.

Example

class Something
{
    private function foo() {} // unused
}

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

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

            } else {
                $tmp .= $login[$i];
            }
Severity: Minor
Found in src/Ext/Password.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\Ext\Password' in method 'createFromLogin'.
Open

                return Password::asciiRotxpp($login, $key);
Severity: Minor
Found in src/Ext/Password.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\Ext\Password' in method 'createAccess'.
Open

        $pass = $pass ?: Password::create(12, 'unpronounceable');
Severity: Minor
Found in src/Libs/Database/Database.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 'query'.
Open

        if (ApplicationHelper::isWindows()) {
Severity: Minor
Found in src/Libs/Database/Database.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 private methods such as 'xor'.
Open

    private static function xor($login, $key)
    {
        $tmp = '';

        for ($i = 0, $tmp_count = strlen($login); $i < $tmp_count; $i++) {
Severity: Minor
Found in src/Ext/Password.php by phpmd

UnusedPrivateMethod

Since: 0.2

Unused Private Method detects when a private method is declared but is unused.

Example

class Something
{
    private function foo() {} // unused
}

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

Severity
Category
Status
Source
Language