YetiForceCompany/YetiForceCRM

View on GitHub
tests/App/Utils.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Avoid using static access to class '\App\Utils\Completions' in method 'testCompletions'.
Open

        $this->assertSame('<img src="file.php?module=Documents&action=DownloadFile&record=448&fileid=19&show=true" />', \App\Utils\Completions::decodeCustomTag('<yetiforce type="Documents" crm-id="448" attachment-id="19"></yetiforce>'));
Severity: Minor
Found in tests/App/Utils.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 '\App\Utils\Benchmarks' in method 'testBenchmarks'.
Open

        $benchmarks = \App\Utils\Benchmarks::all();
Severity: Minor
Found in tests/App/Utils.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

Call to undeclared method \Tests\App\Utils::assertSame
Open

        $this->assertSame('<img src="file.php?module=Documents&action=DownloadFile&record=448&fileid=19&show=true" />', \App\Utils\Completions::decodeCustomTag('<yetiforce type="Documents" crm-id="448" attachment-id="19"></yetiforce>'));
Severity: Critical
Found in tests/App/Utils.php by phan

Call to method decodeCustomTag from undeclared class \App\Utils\Completions
Open

        $this->assertSame('<img src="file.php?module=Documents&action=DownloadFile&record=448&fileid=19&show=true" />', \App\Utils\Completions::decodeCustomTag('<yetiforce type="Documents" crm-id="448" attachment-id="19"></yetiforce>'));
Severity: Critical
Found in tests/App/Utils.php by phan

Call to undeclared method \Tests\App\Utils::assertArrayHasKey
Open

        $this->assertArrayHasKey('db', $benchmarks);
Severity: Critical
Found in tests/App/Utils.php by phan

Call to undeclared method \Tests\App\Utils::assertArrayHasKey
Open

        $this->assertArrayHasKey('hardDrive', $benchmarks);
Severity: Critical
Found in tests/App/Utils.php by phan

Call to undeclared method \Tests\App\Utils::assertArrayHasKey
Open

        $this->assertArrayHasKey('cpu', $benchmarks);
Severity: Critical
Found in tests/App/Utils.php by phan

Call to undeclared method \Tests\App\Utils::assertArrayHasKey
Open

        $this->assertArrayHasKey('ram', $benchmarks);
Severity: Critical
Found in tests/App/Utils.php by phan

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return void
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $benchmarks = \App\Utils\Benchmarks::all();
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function testCompletions(): void
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Tests `\App\Utils\Completions` methods.
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return void
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->assertSame('<img src="file.php?module=Documents&action=DownloadFile&record=448&fileid=19&show=true" />', \App\Utils\Completions::decodeCustomTag('<yetiforce type="Documents" crm-id="448" attachment-id="19"></yetiforce>'));
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Tests `\App\Utils\Benchmarks` methods.
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @see \App\Utils\Benchmarks
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * @see \App\Utils\Completions
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function testBenchmarks(): void
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Line exceeds 120 characters; contains 237 characters
Open

        $this->assertSame('<img src="file.php?module=Documents&action=DownloadFile&record=448&fileid=19&show=true" />', \App\Utils\Completions::decodeCustomTag('<yetiforce type="Documents" crm-id="448" attachment-id="19"></yetiforce>'));
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->assertArrayHasKey('hardDrive', $benchmarks);
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->assertArrayHasKey('ram', $benchmarks);
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     *
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->assertArrayHasKey('cpu', $benchmarks);
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->assertArrayHasKey('db', $benchmarks);
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in tests/App/Utils.php by phpcodesniffer

There are no issues that match your filters.

Category
Status