TikiWiki/tiki-manager

View on GitHub
src/Application/Version.php

Summary

Maintainability
A
0 mins
Test Coverage

The class Version has 12 public methods. Consider refactoring Version to keep number of public methods under 10.
Open

class Version
{
    const SQL_INSERT_VERSION = <<<SQL
        INSERT OR REPLACE INTO
            version
Severity: Minor
Found in src/Application/Version.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

Avoid using static access to class '\TikiManager\Libs\Audit\Checksum' in method 'performCheck'.
Open

        return Checksum::validate($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

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\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 '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

Avoid using static access to class '\TikiManager\Libs\Audit\Checksum' in method 'recordFiles'.
Open

        return Checksum::addFiles($this->id, $hashFiles);
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::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 'replaceFile'.
Open

        return Checksum::replaceFile($this->id, $hash, $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 'collectChecksumFromSource'.
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

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 'hasChecksums'.
Open

        return Checksum::hasChecksums($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\Audit\Checksum' in method 'performCheck'.
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 'replaceFiles'.
Open

        return Checksum::replaceFiles($this->id, $hashFiles);
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 'recordFile'.
Open

        return Checksum::addFile($this->id, $hash, $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\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

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 'collectChecksumFromSource'.
Open

        $result = Checksum::checksumSource($this, $app);
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

Argument 1 (str) is null but \strtolower() takes string
Open

        $v->type = strtolower($type);
Severity: Minor
Found in src/Application/Version.php by phan

The property $date_revision is not named in camelCase.
Open

class Version
{
    const SQL_INSERT_VERSION = <<<SQL
        INSERT OR REPLACE INTO
            version
Severity: Minor
Found in src/Application/Version.php by phpmd

CamelCasePropertyName

Since: 0.2

It is considered best practice to use the camelCase notation to name attributes.

Example

class ClassName {
    protected $property_name;
}

Source

There are no issues that match your filters.

Category
Status