YetiForceCompany/YetiForceCRM

View on GitHub
tests/App/QueryGenerator.php

Summary

Maintainability
A
2 hrs
Test Coverage
A
100%

Method testAdvancedConditions has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testAdvancedConditions()
    {
        $moduleName = 'Accounts';
        $accountModel = \Tests\Base\C_RecordActions::createAccountRecord();
        $contactId = \Tests\Base\C_RecordActions::createContactRecord()->getId();
Severity: Major
Found in tests/App/QueryGenerator.php - About 2 hrs to fix

    Missing class import via use statement (line '89', column '38').
    Open

            $this->logs['DocumentsRel'] = (new \App\Db\Query())->from('vtiger_senotesrel')->all();
    Severity: Minor
    Found in tests/App/QueryGenerator.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 '59', column '25').
    Open

            $queryGenerator = new \App\QueryGenerator($moduleName);
    Severity: Minor
    Found in tests/App/QueryGenerator.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 '27', column '25').
    Open

            $queryGenerator = new \App\QueryGenerator($moduleName);
    Severity: Minor
    Found in tests/App/QueryGenerator.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 '49', column '23').
    Open

                'Accounts' => (new \App\Db\Query())->select(['accountid', 'accountname', 'deleted'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_account.accountid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
    Severity: Minor
    Found in tests/App/QueryGenerator.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 '88', column '35').
    Open

            $this->logs['Documents'] = (new \App\Db\Query())->select(['vtiger_notes.notesid', 'title', 'deleted'])->from('vtiger_notes')->innerJoin('vtiger_crmentity', 'vtiger_notes.notesid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1);
    Severity: Minor
    Found in tests/App/QueryGenerator.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 '50', column '23').
    Open

                'Contacts' => (new \App\Db\Query())->select(['contactid', 'lastname', 'deleted'])->from('vtiger_contactdetails')->innerJoin('vtiger_crmentity', 'vtiger_contactdetails.contactid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
    Severity: Minor
    Found in tests/App/QueryGenerator.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 '80', column '25').
    Open

            $queryGenerator = new \App\QueryGenerator($moduleName);
    Severity: Minor
    Found in tests/App/QueryGenerator.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 '\Tests\Base\C_RecordActions' in method 'testAdvancedConditions'.
    Open

            $accountModel = \Tests\Base\C_RecordActions::createAccountRecord();
    Severity: Minor
    Found in tests/App/QueryGenerator.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\Condition' in method 'testAdvancedConditions'.
    Open

            $searchParams = \App\Condition::validSearchParams($moduleName, [[['relationColumn_1', 'a', $contactId]]]);
    Severity: Minor
    Found in tests/App/QueryGenerator.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 '\Tests\Base\C_RecordActions' in method 'testAdvancedConditions'.
    Open

            $documentModel = \Tests\Base\C_RecordActions::createDocumentsRecord();
    Severity: Minor
    Found in tests/App/QueryGenerator.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\Condition' in method 'testAdvancedConditions'.
    Open

            $searchParams = \App\Condition::validSearchParams($moduleName, [[['relationColumn_' . $relationId, 'a', $documentModel->getId()]]]);
    Severity: Minor
    Found in tests/App/QueryGenerator.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 "value" 3 times.
    Open

                        'value' => $contactId,
    Severity: Critical
    Found in tests/App/QueryGenerator.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 "relationId" 3 times.
    Open

            $queryGenerator->setAdvancedConditions(['relationId' => '0', 'relationColumns' => ['1']]);
    Severity: Critical
    Found in tests/App/QueryGenerator.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 "accountname" 7 times.
    Open

                'Accounts' => (new \App\Db\Query())->select(['accountid', 'accountname', 'deleted'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_account.accountid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
    Severity: Critical
    Found in tests/App/QueryGenerator.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 "deleted" 3 times.
    Open

                'Accounts' => (new \App\Db\Query())->select(['accountid', 'accountname', 'deleted'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_account.accountid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
    Severity: Critical
    Found in tests/App/QueryGenerator.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 "vtiger_crmentity" 3 times.
    Open

                'Accounts' => (new \App\Db\Query())->select(['accountid', 'accountname', 'deleted'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_account.accountid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
    Severity: Critical
    Found in tests/App/QueryGenerator.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\QueryGenerator::assertEquals
    Open

            $this->assertEquals([
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to undeclared method \App\Db\Query::select
    Open

                'Contacts' => (new \App\Db\Query())->select(['contactid', 'lastname', 'deleted'])->from('vtiger_contactdetails')->innerJoin('vtiger_crmentity', 'vtiger_contactdetails.contactid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

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

            $this->assertEquals($accountModel->get('accountname'), $row['accountname']);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

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

            $this->assertEquals($accountModel->getId(), $row['id']);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

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

            $this->assertEquals($accountModel->get('accountname'), $row['accountname']);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to undeclared method \App\Db\Query::select
    Open

            $this->logs['Documents'] = (new \App\Db\Query())->select(['vtiger_notes.notesid', 'title', 'deleted'])->from('vtiger_notes')->innerJoin('vtiger_crmentity', 'vtiger_notes.notesid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to method __construct from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $queryGenerator = new \App\QueryGenerator($moduleName);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to undeclared method \App\Db\Query::select
    Open

                'Accounts' => (new \App\Db\Query())->select(['accountid', 'accountname', 'deleted'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_account.accountid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Argument 1 (sourceRecordId) is null but \Vtiger_Relation_Model::addRelation() takes int defined at /code/modules/Vtiger/models/Relation.php:625
    Open

            \Vtiger_Relation_Model::getInstanceById($relationId)->addRelation($row['id'], $documentModel->getId());
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phan

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

            $this->assertEquals($accountModel->getId(), $row['id']);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to method createQuery from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $this->logs['AccountsAdvancedConditions'] = $rows = $queryGenerator->createQuery()->createCommand()->queryAllByGroup(1);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Invalid offset "accountname" of array type array{}
    Open

            $this->assertEquals($accountModel->get('accountname'), $row['accountname']);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phan

    Call to method parseBaseSearchParamsToCondition from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $transformedSearchParams = $queryGenerator->parseBaseSearchParamsToCondition($searchParams);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to undeclared method \App\Db\Query::from
    Open

            $this->logs['DocumentsRel'] = (new \App\Db\Query())->from('vtiger_senotesrel')->all();
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to method parseAdvFilter from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $queryGenerator->parseAdvFilter($transformedSearchParams);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to method createQuery from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $row = $queryGenerator->createQuery()->one() ?? [];
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

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

            $this->assertArrayHasKey($accountModel->getId(), $rows);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to method setAdvancedConditions from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $queryGenerator->setAdvancedConditions(['relationId' => '0', 'relationColumns' => ['1']]);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to method createQuery from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

                'query' => $queryGenerator->createQuery()->createCommand()->getRawSql(),
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Invalid offset "id" of array type array{}
    Open

            $this->assertEquals($accountModel->getId(), $row['id']);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phan

    Call to method setFields from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $queryGenerator->setFields(['id', 'accountname']);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to method initForDefaultCustomView from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $queryGenerator->initForDefaultCustomView();
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to method setFields from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $queryGenerator->setFields(['id', 'accountname']);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Invalid offset "id" of array type array{}
    Open

            \Vtiger_Relation_Model::getInstanceById($relationId)->addRelation($row['id'], $documentModel->getId());
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phan

    Invalid offset "accountname" of array type array{}
    Open

            $this->assertEquals($accountModel->get('accountname'), $row['accountname']);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phan

    Invalid offset "id" of array type array{}
    Open

            $this->assertEquals($accountModel->getId(), $row['id']);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phan

    Call to method createQuery from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $row = $queryGenerator->createQuery()->one() ?? [];
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to method parseBaseSearchParamsToCondition from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $transformedSearchParams = $queryGenerator->parseBaseSearchParamsToCondition($searchParams);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

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

            $this->assertEquals([
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to method parseAdvFilter from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $queryGenerator->parseAdvFilter($transformedSearchParams);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to method setAdvancedConditions from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $queryGenerator->setAdvancedConditions([
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to method __construct from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $queryGenerator = new \App\QueryGenerator($moduleName);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to method setAdvancedConditions from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $queryGenerator->setAdvancedConditions(['relationId' => '0', 'relationColumns' => [$relationId]]);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Call to method __construct from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $queryGenerator = new \App\QueryGenerator($moduleName);
    Severity: Critical
    Found in tests/App/QueryGenerator.php by phan

    Avoid excessively long variable names like $transformedSearchParams. Keep variable name length under 20.
    Open

            $transformedSearchParams = $queryGenerator->parseBaseSearchParamsToCondition($searchParams);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpmd

    LongVariable

    Since: 0.2

    Detects when a field, formal or local variable is declared with a long name.

    Example

    class Something {
        protected $reallyLongIntName = -3; // VIOLATION - Field
        public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
            $otherReallyLongName = -5; // VIOLATION - Local
            for ($interestingIntIndex = 0; // VIOLATION - For
                 $interestingIntIndex < 10;
                 $interestingIntIndex++ ) {
            }
        }
    }

    Source https://phpmd.org/rules/naming.html#longvariable

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

            $queryGenerator->setAdvancedConditions(['relationId' => '0', 'relationColumns' => ['1']]);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                    ],
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $row = $queryGenerator->createQuery()->one() ?? [];
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

    Line exceeds 120 characters; contains 242 characters
    Open

                'Accounts' => (new \App\Db\Query())->select(['accountid', 'accountname', 'deleted'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_account.accountid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                    [
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $queryGenerator->parseAdvFilter($transformedSearchParams);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $row = $queryGenerator->createQuery()->one() ?? [];
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

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

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

            $queryGenerator = new \App\QueryGenerator($moduleName);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

    Line exceeds 120 characters; contains 253 characters
    Open

                'Contacts' => (new \App\Db\Query())->select(['contactid', 'lastname', 'deleted'])->from('vtiger_contactdetails')->innerJoin('vtiger_crmentity', 'vtiger_contactdetails.contactid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                ],
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $this->assertEquals($accountModel->get('accountname'), $row['accountname']);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $this->logs['DocumentsRel'] = (new \App\Db\Query())->from('vtiger_senotesrel')->all();
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $moduleName = 'Accounts';
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $transformedSearchParams = $queryGenerator->parseBaseSearchParamsToCondition($searchParams);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

    Line exceeds 120 characters; contains 180 characters
    Open

                'relationConditions' => ['condition' => 'AND', 'rules' => [['fieldname' => 'notes_title:Documents', 'operator' => 'e', 'value' => $documentModel->get('notes_title')]]],
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $contactId = \Tests\Base\C_RecordActions::createContactRecord()->getId();
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                        'field_name' => 'relationColumn_1',
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                        'source_field_name' => false,
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $this->assertArrayHasKey($accountModel->getId(), $rows);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

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

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

                        'comparator' => 'a',
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            \Vtiger_Relation_Model::getInstanceById($relationId)->addRelation($row['id'], $documentModel->getId());
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $searchParams = \App\Condition::validSearchParams($moduleName, [[['relationColumn_1', 'a', $contactId]]]);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                        'value' => $contactId,
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                'contactId' => $contactId,
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $queryGenerator->setFields(['id', 'accountname']);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $queryGenerator->initForDefaultCustomView();
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                    [
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                        'source_field_name' => false,
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $relationId = 9;
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $documentModel = \Tests\Base\C_RecordActions::createDocumentsRecord();
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                        'value' => $documentModel->getId(),
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                'and' => [
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            ], $transformedSearchParams);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            ]);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $this->logs['AccountsAdvancedConditions'] = $rows = $queryGenerator->createQuery()->createCommand()->queryAllByGroup(1);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

         * Advanced conditions test.
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $this->assertEquals([
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                'and' => [
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $queryGenerator->parseAdvFilter($transformedSearchParams);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $queryGenerator = new \App\QueryGenerator($moduleName);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $this->logs['DocumentsId'] = $documentModel->getId();
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $this->logs['Documents'] = (new \App\Db\Query())->select(['vtiger_notes.notesid', 'title', 'deleted'])->from('vtiger_notes')->innerJoin('vtiger_crmentity', 'vtiger_notes.notesid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

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

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

                'Accounts' => (new \App\Db\Query())->select(['accountid', 'accountname', 'deleted'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_account.accountid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $queryGenerator = new \App\QueryGenerator($moduleName);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $queryGenerator->setAdvancedConditions([
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $accountModel = \Tests\Base\C_RecordActions::createAccountRecord();
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                'query' => $queryGenerator->createQuery()->createCommand()->getRawSql(),
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

    Line exceeds 120 characters; contains 140 characters
    Open

            $searchParams = \App\Condition::validSearchParams($moduleName, [[['relationColumn_' . $relationId, 'a', $documentModel->getId()]]]);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                'relationId' => $relationId,
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $this->assertEquals([
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                        'field_name' => 'relationColumn_' . $relationId,
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                        'module_name' => false,
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

    Line exceeds 120 characters; contains 250 characters
    Open

            $this->logs['Documents'] = (new \App\Db\Query())->select(['vtiger_notes.notesid', 'title', 'deleted'])->from('vtiger_notes')->innerJoin('vtiger_crmentity', 'vtiger_notes.notesid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

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

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

            ], $transformedSearchParams);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            ];
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $this->assertEquals($accountModel->getId(), $row['id']);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $transformedSearchParams = $queryGenerator->parseBaseSearchParamsToCondition($searchParams);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $this->logs = [
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                'Contacts' => (new \App\Db\Query())->select(['contactid', 'lastname', 'deleted'])->from('vtiger_contactdetails')->innerJoin('vtiger_crmentity', 'vtiger_contactdetails.contactid = vtiger_crmentity.crmid')->createCommand()->queryAllByGroup(1),
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                    ],
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                        'module_name' => false,
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $queryGenerator->setFields(['id', 'accountname']);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

    Line exceeds 120 characters; contains 128 characters
    Open

            $this->logs['AccountsAdvancedConditions'] = $rows = $queryGenerator->createQuery()->createCommand()->queryAllByGroup(1);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

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

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

                ],
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                'accountId' => $accountModel->getId(),
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $this->assertEquals($accountModel->get('accountname'), $row['accountname']);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $queryGenerator->setAdvancedConditions(['relationId' => '0', 'relationColumns' => [$relationId]]);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $searchParams = \App\Condition::validSearchParams($moduleName, [[['relationColumn_' . $relationId, 'a', $documentModel->getId()]]]);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                        'comparator' => 'a',
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

            $this->assertEquals($accountModel->getId(), $row['id']);
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

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

                'relationConditions' => ['condition' => 'AND', 'rules' => [['fieldname' => 'notes_title:Documents', 'operator' => 'e', 'value' => $documentModel->get('notes_title')]]],
    Severity: Minor
    Found in tests/App/QueryGenerator.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status