YetiForceCompany/YetiForceCRM

View on GitHub
tests/App/Db_Fixer.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Avoid using static access to class '\App\Db\Fixer' in method 'testFixerDb'.
Open

        $fields = \App\Db\Fixer::maximumFieldsLength(['fieldname' => 'email']);
Severity: Minor
Found in tests/App/Db_Fixer.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\Db\Fixer' in method 'testFixerDb'.
Open

        $this->assertSame(0, \App\Db\Fixer::profileField());
Severity: Minor
Found in tests/App/Db_Fixer.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\Db\Fixer' in method 'testFixerDb'.
Open

        $fields = \App\Db\Fixer::maximumFieldsLength();
Severity: Minor
Found in tests/App/Db_Fixer.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\Db\Fixer' in method 'testFixerDb'.
Open

        $this->assertSame(0, \App\Db\Fixer::share());
Severity: Minor
Found in tests/App/Db_Fixer.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\Db\Fixer' in method 'testFixerDb'.
Open

        $this->assertSame(0, \App\Db\Fixer::baseModuleTools());
Severity: Minor
Found in tests/App/Db_Fixer.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\Db\Fixer' in method 'testFixerDb'.
Open

        $this->assertSame(0, \App\Db\Fixer::baseModuleActions());
Severity: Minor
Found in tests/App/Db_Fixer.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

Define a constant instead of duplicating this literal "RequiresVerification" 4 times.
Open

        if (0 != $fields['RequiresVerification']) {
Severity: Critical
Found in tests/App/Db_Fixer.php by sonar-php

Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

Noncompliant Code Example

With the default threshold of 3:

function run() {
  prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
  execute('action1');
  release('action1');
}

Compliant Solution

ACTION_1 = 'action1';

function run() {
  prepare(ACTION_1);
  execute(ACTION_1);
  release(ACTION_1);
}

Exceptions

To prevent generating some false-positives, literals having less than 5 characters are excluded.

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

        $this->assertSame(0, $fields['TypeNotFound']);
Severity: Critical
Found in tests/App/Db_Fixer.php by phan

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

        $this->assertSame(0, \App\Db\Fixer::baseModuleActions());
Severity: Critical
Found in tests/App/Db_Fixer.php by phan

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

        $this->assertSame(0, \App\Db\Fixer::profileField());
Severity: Critical
Found in tests/App/Db_Fixer.php by phan

Call to undeclared method \Tests\App\Db_Fixer::markTestSkipped
Open

            $this->markTestSkipped('Fields for verification detected:' . $fields['RequiresVerification']);
Severity: Critical
Found in tests/App/Db_Fixer.php by phan

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

        $this->assertSame(0, $fields['Updated']);
Severity: Critical
Found in tests/App/Db_Fixer.php by phan

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

        $this->assertSame(0, $fields['TypeNotFound']);
Severity: Critical
Found in tests/App/Db_Fixer.php by phan

Call to undeclared method \Tests\App\Db_Fixer::markTestSkipped
Open

            $this->markTestSkipped('Fields for verification detected:' . $fields['RequiresVerification']);
Severity: Critical
Found in tests/App/Db_Fixer.php by phan

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

        $this->assertSame(0, \App\Db\Fixer::share());
Severity: Critical
Found in tests/App/Db_Fixer.php by phan

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

        $this->assertSame(0, $fields['Updated']);
Severity: Critical
Found in tests/App/Db_Fixer.php by phan

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

        $this->assertSame(0, \App\Db\Fixer::baseModuleTools());
Severity: Critical
Found in tests/App/Db_Fixer.php by phan

The class Db_Fixer is not named in CamelCase.
Open

class Db_Fixer extends \Tests\Base
{
    /**
     * Testing fixer function.
     */
Severity: Minor
Found in tests/App/Db_Fixer.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

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

        $this->assertSame(0, $fields['Updated']);
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

        $this->assertSame(0, $fields['TypeNotFound']);
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

        $this->assertSame(0, $fields['Updated']);
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

    public function testFixerDb()
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

        $this->assertSame(0, \App\Db\Fixer::baseModuleActions());
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

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

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

        // @codeCoverageIgnoreStart
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

        $this->assertSame(0, \App\Db\Fixer::share());
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

     * Testing fixer function.
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

        $this->assertSame(0, \App\Db\Fixer::baseModuleTools());
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

        /** @codeCoverageIgnoreEnd */
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

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

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

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

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

        // @codeCoverageIgnoreStart
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

        if (0 != $fields['RequiresVerification']) {
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

            $this->markTestSkipped('Fields for verification detected:' . $fields['RequiresVerification']);
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

        $this->assertSame(0, $fields['TypeNotFound']);
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

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

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

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

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

        $fields = \App\Db\Fixer::maximumFieldsLength();
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

        $fields = \App\Db\Fixer::maximumFieldsLength(['fieldname' => 'email']);
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

        // @codeCoverageIgnoreEnd
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

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

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

        $this->assertSame(0, \App\Db\Fixer::profileField());
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

        if (0 != $fields['RequiresVerification']) {
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

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

            $this->markTestSkipped('Fields for verification detected:' . $fields['RequiresVerification']);
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

Class name "Db_Fixer" is not in camel caps format
Open

class Db_Fixer extends \Tests\Base
Severity: Minor
Found in tests/App/Db_Fixer.php by phpcodesniffer

There are no issues that match your filters.

Category
Status