YetiForceCompany/YetiForceCRM

View on GitHub
tests/App/RecordConverter.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Avoid using static access to class '\App\RecordConverter' in method 'testInitialize'.
Open

        $this->assertTrue(\App\RecordConverter::isActive('SQuotes', 'Detail'));
Severity: Minor
Found in tests/App/RecordConverter.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\Json' in method 'testInitialize'.
Open

                'field_mapping' => \App\Json::encode(
                    ['auto']
                ),
Severity: Minor
Found in tests/App/RecordConverter.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\Json' in method 'testInitialize'.
Open

                'inv_field_mapping' => \App\Json::encode(
                    ['auto']
                ),
Severity: Minor
Found in tests/App/RecordConverter.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

Remove this commented out code.
Open

            // $this->assertCount(1, $convertInstance->createdRecords);
Severity: Major
Found in tests/App/RecordConverter.php by sonar-php

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Remove this commented out code.
Open

        // $id = (new \App\Db\Query())->select(['squotesid'])->from('u_#__squotes')->scalar();
Severity: Major
Found in tests/App/RecordConverter.php by sonar-php

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

Remove this commented out code.
Open

            // ];
Severity: Major
Found in tests/App/RecordConverter.php by sonar-php

Programmers should not comment out code as it bloats programs and reduces readability.

Unused code should be deleted and can be retrieved from source control history if required.

See

  • MISRA C:2004, 2.4 - Sections of code should not be "commented out".
  • MISRA C++:2008, 2-7-2 - Sections of code shall not be "commented out" using C-style comments.
  • MISRA C++:2008, 2-7-3 - Sections of code should not be "commented out" using C++ comments.
  • MISRA C:2012, Dir. 4.4 - Sections of code should not be "commented out"

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

        $this->markTestSkipped('unfinished');
Severity: Critical
Found in tests/App/RecordConverter.php by phan

Call to undeclared method \App\Db::createCommand
Open

        $dbCommand = \App\Db::getInstance('admin')->createCommand();
Severity: Critical
Found in tests/App/RecordConverter.php by phan

Call to undeclared method \Tests\App\RecordConverter::assertTrue
Open

        $this->assertTrue(\App\RecordConverter::isActive('SQuotes', 'Detail'));
Severity: Critical
Found in tests/App/RecordConverter.php by phan

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 ($id) {

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

            // $convertInstance->process([$id]);

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

            // $this->assertCount(1, $convertInstance->createdRecords);

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

     * Initialize test.

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

                'field_mapping' => \App\Json::encode(

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

            // $this->logs = [

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

                'status' => 1,

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

                'inv_field_mapping' => \App\Json::encode(

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

                'show_in_list' => 1,

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

                'show_in_detail' => 1,

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

        $dbCommand = \App\Db::getInstance('admin')->createCommand();

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

        )->execute();

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

            'a_yf_record_converter',

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

                'name' => 'Record converter test',

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

    /**

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

            //     'inventory' => $recordModel->getInventoryData(),

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

            // foreach ($convertInstance->createdRecords as $id) {

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

                    ['auto']

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

        $this->markTestSkipped('unfinished');

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

            //     'data' => $recordModel->getData(),

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

    public function testProcess()

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->assertTrue((new \App\Db\Query())->from('u_yf_ssingleorders')->where(['ssingleordersid' => $id])->exists());

Line exceeds 120 characters; contains 130 characters
Open

            //     $this->assertTrue((new \App\Db\Query())->from('u_yf_ssingleorders')->where(['ssingleordersid' => $id])->exists());

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

     */

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

                'destiny_module' => 90,

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 testInitialize()

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

        $this->assertTrue(\App\RecordConverter::isActive('SQuotes', 'Detail'));

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

            // $convertInstance = \App\RecordConverter::getInstanceById(1);

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

        $dbCommand->insert(

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

                    ['auto']

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

            // $recordModel = \Vtiger_Record_Model::getInstanceById($id, 'SQuotes');

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

                'source_module' => 89,

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

            // }

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

     * Process test.

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

    {

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

        // $id = (new \App\Db\Query())->select(['squotesid'])->from('u_#__squotes')->scalar();

There are no issues that match your filters.

Category
Status