YetiForceCompany/YetiForceCRM

View on GitHub
tests/App/RecordCollector.php

Summary

Maintainability
B
5 hrs
Test Coverage
A
100%

Missing class import via use statement (line '63', column '36').
Open

        $recordCollector->setRequest(new \App\Request([
Severity: Minor
Found in tests/App/RecordCollector.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '175', column '36').
Open

        $recordCollector->setRequest(new \App\Request([
Severity: Minor
Found in tests/App/RecordCollector.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '120', column '36').
Open

        $recordCollector->setRequest(new \App\Request([
Severity: Minor
Found in tests/App/RecordCollector.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '92', column '36').
Open

        $recordCollector->setRequest(new \App\Request([
Severity: Minor
Found in tests/App/RecordCollector.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '34', column '36').
Open

        $recordCollector->setRequest(new \App\Request([
Severity: Minor
Found in tests/App/RecordCollector.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '147', column '36').
Open

        $recordCollector->setRequest(new \App\Request([
Severity: Minor
Found in tests/App/RecordCollector.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Avoid using static access to class '\App\RecordCollector' in method 'testPlKrs'.
Open

        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\PlKrs', 'Accounts');
Severity: Minor
Found in tests/App/RecordCollector.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 testVies uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            // @codeCoverageIgnoreStart
            $this->markTestSkipped($response['error']);
            // @codeCoverageIgnoreEnd
        }
Severity: Minor
Found in tests/App/RecordCollector.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 '\App\RecordCollector' in method 'testDkCvr'.
Open

        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\DkCvr', 'Accounts');
Severity: Minor
Found in tests/App/RecordCollector.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 testFrEnterpriseGouv uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            // @codeCoverageIgnoreStart
            $this->markTestSkipped($response['error']);
            // @codeCoverageIgnoreEnd
        }
Severity: Minor
Found in tests/App/RecordCollector.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 '\App\RecordCollector' in method 'testUsaEdgarRegistryFromSec'.
Open

        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\UsaEdgarRegistryFromSec', 'Accounts');
Severity: Minor
Found in tests/App/RecordCollector.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 testDkCvr uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            // @codeCoverageIgnoreStart
            $this->markTestSkipped($response['error']);
            // @codeCoverageIgnoreEnd
        }
Severity: Minor
Found in tests/App/RecordCollector.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 '\App\RecordCollector' in method 'testFrEnterpriseGouv'.
Open

        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\FrEnterpriseGouv', 'Accounts');
Severity: Minor
Found in tests/App/RecordCollector.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 testUsaEdgarRegistryFromSec uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            // @codeCoverageIgnoreStart
            $this->markTestSkipped($response['error']);
            // @codeCoverageIgnoreEnd
        }
Severity: Minor
Found in tests/App/RecordCollector.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 '\App\RecordCollector' in method 'testVies'.
Open

        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\Vies', 'Accounts');
Severity: Minor
Found in tests/App/RecordCollector.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 testNoBrregEnhetsregisteret uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            // @codeCoverageIgnoreStart
            $this->markTestSkipped($response['error']);
            // @codeCoverageIgnoreEnd
        }
Severity: Minor
Found in tests/App/RecordCollector.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 testPlKrs uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            // @codeCoverageIgnoreStart
            $this->markTestSkipped($response['error']);
            // @codeCoverageIgnoreEnd
        }
Severity: Minor
Found in tests/App/RecordCollector.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 '\App\RecordCollector' in method 'testNoBrregEnhetsregisteret'.
Open

        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\NoBrregEnhetsregisteret', 'Accounts');
Severity: Minor
Found in tests/App/RecordCollector.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 "vatNumber" 3 times.
Open

            'vatNumber' => '1180002425',
Severity: Critical
Found in tests/App/RecordCollector.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.

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

            $this->assertArrayHasKey('additional', $response);
Severity: Critical
Found in tests/App/RecordCollector.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.

Define a constant instead of duplicating this literal "Accounts" 12 times.
Open

        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\Vies', 'Accounts');
Severity: Critical
Found in tests/App/RecordCollector.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.

Define a constant instead of duplicating this literal "error" 12 times.
Open

        if (empty($response['error'])) {
Severity: Critical
Found in tests/App/RecordCollector.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.

Define a constant instead of duplicating this literal "fields" 10 times.
Open

            $this->assertArrayHasKey('fields', $response);
Severity: Critical
Found in tests/App/RecordCollector.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.

Define a constant instead of duplicating this literal "module" 6 times.
Open

            'module' => 'Accounts',
Severity: Critical
Found in tests/App/RecordCollector.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.

Define a constant instead of duplicating this literal "No required access to test this functionality" 5 times.
Open

            $this->markTestSkipped('No required access to test this functionality');
Severity: Critical
Found in tests/App/RecordCollector.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\RecordCollector::assertArrayHasKey
Open

            $this->assertArrayHasKey('links', $response);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->assertArrayHasKey('fields', $response);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->assertArrayHasKey('LBL_REQUEST_ID', $response['fields']);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->assertArrayHasKey('links', $response);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->markTestSkipped('No required access to test this functionality');
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->assertArrayHasKey('fields', $response);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->markTestSkipped('No required access to test this functionality');
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to method isActive from undeclared class \App\RecordCollectors\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

        if (!$recordCollector->isActive()) {
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to method setRequest from undeclared class \App\RecordCollectors\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

        $recordCollector->setRequest(new \App\Request([
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->markTestSkipped($response['error']);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to method isActive from undeclared class \App\RecordCollectors\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

        if (!$recordCollector->isActive()) {
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to undeclared method \Tests\App\RecordCollector::assertEquals
Open

            $this->assertEquals('1180002425', $response['fields']['vat_id']['data'][0]['raw']);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->assertArrayHasKey('fields', $response);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->assertArrayHasKey('additional', $response);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->markTestSkipped('No required access to test this functionality');
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->markTestSkipped($response['error']);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to method setRequest from undeclared class \App\RecordCollectors\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

        $recordCollector->setRequest(new \App\Request([
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to method isActive from undeclared class \App\RecordCollectors\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

        if (!$recordCollector->isActive()) {
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to undeclared method \Tests\App\RecordCollector::assertEquals
Open

            $this->assertEquals('PL1180002425', $response['fields']['Vat ID'] ?? 'No value');
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to method search from undeclared class \App\RecordCollectors\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

        $response = $recordCollector->search();
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->markTestSkipped($response['error']);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to method isActive from undeclared class \App\RecordCollectors\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

        if (!$recordCollector->isActive()) {
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to method setRequest from undeclared class \App\RecordCollectors\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

        $recordCollector->setRequest(new \App\Request([
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to method setRequest from undeclared class \App\RecordCollectors\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

        $recordCollector->setRequest(new \App\Request([
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->markTestSkipped($response['error']);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->markTestSkipped('No required access to test this functionality');
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to method search from undeclared class \App\RecordCollectors\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

        $response = $recordCollector->search();
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->assertArrayHasKey('fields', $response);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to method search from undeclared class \App\RecordCollectors\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

        $response = $recordCollector->search();
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->assertArrayHasKey('fields', $response);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->assertArrayHasKey('additional', $response);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to method isActive from undeclared class \App\RecordCollectors\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

        if (!$recordCollector->isActive()) {
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to method search from undeclared class \App\RecordCollectors\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

        $response = $recordCollector->search();
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to method search from undeclared class \App\RecordCollectors\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

        $response = $recordCollector->search();
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->assertArrayHasKey('additional', $response);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->markTestSkipped($response['error']);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->markTestSkipped($response['error']);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->markTestSkipped('No required access to test this functionality');
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to undeclared method \Tests\App\RecordCollector::assertEquals
Open

            $this->assertEquals('00816349200000', $response['fields']['registration_number_2']['data'][0]['raw']);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->assertArrayHasKey('fields', $response);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

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

            $this->assertArrayHasKey('additional', $response);
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to method setRequest from undeclared class \App\RecordCollectors\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

        $recordCollector->setRequest(new \App\Request([
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to method search from undeclared class \App\RecordCollectors\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

        $response = $recordCollector->search();
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Call to method setRequest from undeclared class \App\RecordCollectors\Base (Did you mean class \App\Base or class \App\Cache\Base or class \App\Cli\Base or class \App\Controller\Base or class \App\Controller\View\Base or class \App\Db\Importers\Base or class \Tests\Base)
Open

        $recordCollector->setRequest(new \App\Request([
Severity: Critical
Found in tests/App/RecordCollector.php by phan

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public function testFrEnterpriseGouv(): void
    {
        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\FrEnterpriseGouv', 'Accounts');
        if (!$recordCollector->isActive()) {
            $this->markTestSkipped('No required access to test this functionality');
Severity: Major
Found in tests/App/RecordCollector.php and 1 other location - About 2 hrs to fix
tests/App/RecordCollector.php on lines 168..188

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 136.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public function testUsaEdgarRegistryFromSec(): void
    {
        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\UsaEdgarRegistryFromSec', 'Accounts');
        if (!$recordCollector->isActive()) {
            $this->markTestSkipped('No required access to test this functionality');
Severity: Major
Found in tests/App/RecordCollector.php and 1 other location - About 2 hrs to fix
tests/App/RecordCollector.php on lines 113..133

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 136.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\Vies', 'Accounts');

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

    {

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

        }

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

            $this->assertArrayHasKey('links', $response);

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

        if (!$recordCollector->isActive()) {

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

            // @codeCoverageIgnoreStart

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

     *

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

        $recordCollector->setRequest(new \App\Request([

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

            $this->assertArrayHasKey('additional', $response);

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

    {

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

        if (!$recordCollector->isActive()) {

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

     * Vies record collector test.

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

            'countryCode' => 'PL',

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

    /**

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

     */

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

     * @return void

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

        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\PlKrs', 'Accounts');

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

        }

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

            // @codeCoverageIgnoreStart

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

            // @codeCoverageIgnoreStart

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

    {

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

            $this->markTestSkipped($response['error']);

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

        ], false));

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

            // @codeCoverageIgnoreStart

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

     * DkCvr record collector test.

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

        if (!$recordCollector->isActive()) {

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

            'module' => 'Accounts',

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

     */

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

            return;

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

            'module' => 'Accounts',

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

            $this->assertArrayHasKey('additional', $response);

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

    /**

Line exceeds 120 characters; contains 121 characters
Open

        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\NoBrregEnhetsregisteret', 'Accounts');

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

            // @codeCoverageIgnoreEnd

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

    public function testUsaEdgarRegistryFromSec(): void

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

    {

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

            'vatNumber' => '1180002425',

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

    }

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

            $this->markTestSkipped('No required access to test this functionality');

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

            'name' => 'test',

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

        ], false));

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

     * NoBrregEnhetsregisteret record collector test.

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

        if (!$recordCollector->isActive()) {

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

            $this->markTestSkipped('No required access to test this functionality');

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

        } else {

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

     * @return void

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

     */

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

        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\FrEnterpriseGouv', 'Accounts');

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

        if (empty($response['error'])) {

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

     */

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

            $this->assertArrayHasKey('fields', $response);

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

            $this->assertArrayHasKey('LBL_REQUEST_ID', $response['fields']);

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

     */

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

            $this->markTestSkipped('No required access to test this functionality');

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

     *

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

    public function testFrEnterpriseGouv(): void

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

        } else {

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

     *

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

            'vatNumber' => '923486178',

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

        $response = $recordCollector->search();

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

        }

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

            return;

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

    /**

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

    public function testDkCvr(): void

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

    {

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

    /**

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

    {

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

        $response = $recordCollector->search();

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

            return;

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

        }

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

    }

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

            $this->assertArrayHasKey('fields', $response);

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

        }

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

     *

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

        $response = $recordCollector->search();

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

            $this->assertEquals('PL1180002425', $response['fields']['Vat ID'] ?? 'No value');

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

            // @codeCoverageIgnoreEnd

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

     *

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

            'module' => 'Accounts',

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

        ], false));

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

        if (empty($response['error'])) {

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

    }

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

        }

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

            $this->markTestSkipped($response['error']);

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

        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\NoBrregEnhetsregisteret', 'Accounts');

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

            'module' => 'Accounts',

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

        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\UsaEdgarRegistryFromSec', 'Accounts');

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

    public function testVies(): void

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

        ], false));

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

        } else {

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

            // @codeCoverageIgnoreStart

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

        }

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

            'ncr' => '0000940956',

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

        } else {

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

        } else {

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

            $this->markTestSkipped('No required access to test this functionality');

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

        $recordCollector->setRequest(new \App\Request([

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

            $this->assertArrayHasKey('fields', $response);

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

            return;

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

            'module' => 'Accounts',

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

            $this->markTestSkipped($response['error']);

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

            $this->assertArrayHasKey('additional', $response);

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

     * FrEnterpriseGouv record collector test.

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

        if (empty($response['error'])) {

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

            $this->assertArrayHasKey('links', $response);

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

            // @codeCoverageIgnoreEnd

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

        $recordCollector->setRequest(new \App\Request([

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

            $this->assertEquals('1180002425', $response['fields']['vat_id']['data'][0]['raw']);

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

     * @return void

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

        $recordCollector->setRequest(new \App\Request([

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

        if (empty($response['error'])) {

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

     * @return void

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

            $this->assertArrayHasKey('additional', $response);

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

    /**

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

            $this->markTestSkipped($response['error']);

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

    }

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

        $recordCollector->setRequest(new \App\Request([

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

     * PlKrs record collector test.

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

    public function testPlKrs(): void

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

            $this->assertEquals('00816349200000', $response['fields']['registration_number_2']['data'][0]['raw']);

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

            'country' => 'no',

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

            'vatNumber' => '213305295',

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

        }

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

        $response = $recordCollector->search();

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

            return;

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

            $this->assertArrayHasKey('fields', $response);

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

            $this->markTestSkipped($response['error']);

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

        }

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

    }

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

     * @return void

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

    }

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

    public function testNoBrregEnhetsregisteret(): void

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

            $this->assertArrayHasKey('fields', $response);

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

     * UsaEdgarRegistryFromSec record collector test.

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

        $response = $recordCollector->search();

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

        if (empty($response['error'])) {

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

        if (!$recordCollector->isActive()) {

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

        $recordCollector->setRequest(new \App\Request([

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

        } else {

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

     * @return void

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

            $this->assertArrayHasKey('fields', $response);

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

        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\DkCvr', 'Accounts');

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

        }

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

            // @codeCoverageIgnoreEnd

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

            $this->markTestSkipped('No required access to test this functionality');

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

        ], false));

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

        if (empty($response['error'])) {

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

     */

Line exceeds 120 characters; contains 121 characters
Open

        $recordCollector = \App\RecordCollector::getInstance('App\RecordCollectors\UsaEdgarRegistryFromSec', 'Accounts');

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

            'module' => 'Accounts',

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

            'cik' => '0001823466',

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

    /**

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

            $this->markTestSkipped($response['error']);

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

            // @codeCoverageIgnoreEnd

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

     *

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

        ], false));

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

        $response = $recordCollector->search();

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

            // @codeCoverageIgnoreEnd

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

        }

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

            // @codeCoverageIgnoreStart

There are no issues that match your filters.

Category
Status