YetiForceCompany/YetiForceCRM

View on GitHub
modules/Import/actions/Queue.php

Summary

Maintainability
A
2 hrs
Test Coverage
F
12%

Function add has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static function add(App\Request $request, App\User $user)
    {
        if ($request->get('is_scheduled')) {
            $temp_status = self::$IMPORT_STATUS_SCHEDULED;
        } else {
Severity: Minor
Found in modules/Import/actions/Queue.php - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method add has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function add(App\Request $request, App\User $user)
    {
        if ($request->get('is_scheduled')) {
            $temp_status = self::$IMPORT_STATUS_SCHEDULED;
        } else {
Severity: Minor
Found in modules/Import/actions/Queue.php - About 1 hr to fix

    Missing class import via use statement (line '105', column '20').
    Open

                $rowData = (new App\Db\Query())->from('vtiger_import_queue')->where(['userid' => $user->getId()])->one();
    Severity: Minor
    Found in modules/Import/actions/Queue.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 '123', column '19').
    Open

            $rowData = (new \App\Db\Query())->from('vtiger_import_queue')->where(['tabid' => \App\Module::getModuleId($module), 'userid' => $user->getId()])->one();
    Severity: Minor
    Found in modules/Import/actions/Queue.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

    The method getAll has a boolean flag argument $tempStatus, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public static function getAll($tempStatus = false)
    Severity: Minor
    Found in modules/Import/actions/Queue.php by phpmd

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    Missing class import via use statement (line '29', column '14').
    Open

                throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
    Severity: Minor
    Found in modules/Import/actions/Queue.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 '133', column '20').
    Open

                $rowData = (new App\Db\Query())->from('vtiger_import_queue')->where(['importid' => $importId])->one();
    Severity: Minor
    Found in modules/Import/actions/Queue.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 '143', column '17').
    Open

            $query = (new App\Db\Query())->from('vtiger_import_queue');
    Severity: Minor
    Found in modules/Import/actions/Queue.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 'Users_Privileges_Model' in method 'checkPermission'.
    Open

            $currentUserPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
    Severity: Minor
    Found in modules/Import/actions/Queue.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 assigning values to variables in if clauses and the like (line '55', column '9').
    Open

        public static function add(App\Request $request, App\User $user)
        {
            if ($request->get('is_scheduled')) {
                $temp_status = self::$IMPORT_STATUS_SCHEDULED;
            } else {
    Severity: Minor
    Found in modules/Import/actions/Queue.php by phpmd

    IfStatementAssignment

    Since: 2.7.0

    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($foo = 'bar') { // possible typo
                // ...
            }
            if ($baz = 0) { // always false
                // ...
            }
        }
    }

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

    Avoid using static access to class '\App\Json' in method 'getImportInfoFromResult'.
    Open

                'field_mapping' => \App\Json::decode($rowData['field_mapping']),
    Severity: Minor
    Found in modules/Import/actions/Queue.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 add uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                $temp_status = self::$IMPORT_STATUS_NONE;
            }
    Severity: Minor
    Found in modules/Import/actions/Queue.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\Json' in method 'add'.
    Open

                'merge_fields' => \App\Json::encode($request->get('merge_fields')),
    Severity: Minor
    Found in modules/Import/actions/Queue.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 'vtlib\Utils' in method 'getUserCurrentImportInfo'.
    Open

            if (vtlib\Utils::checkTable('vtiger_import_queue')) {
    Severity: Minor
    Found in modules/Import/actions/Queue.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 'getImportInfoFromResult'.
    Open

                'merge_fields' => \App\Json::decode($rowData['merge_fields']),
    Severity: Minor
    Found in modules/Import/actions/Queue.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 'Vtiger_Module_Model' in method 'add'.
    Open

                $moduleModel = Vtiger_Module_Model::getInstance($request->getModule());
    Severity: Minor
    Found in modules/Import/actions/Queue.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\Module' in method 'getImportInfo'.
    Open

            $rowData = (new \App\Db\Query())->from('vtiger_import_queue')->where(['tabid' => \App\Module::getModuleId($module), 'userid' => $user->getId()])->one();
    Severity: Minor
    Found in modules/Import/actions/Queue.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\Module' in method 'getImportInfoFromResult'.
    Open

                'module' => \App\Module::getModuleName($rowData['tabid']),
    Severity: Minor
    Found in modules/Import/actions/Queue.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 'add'.
    Open

                'field_mapping' => \App\Json::encode($request->get('field_mapping')),
    Severity: Minor
    Found in modules/Import/actions/Queue.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 'vtlib\Utils' in method 'remove'.
    Open

            if (vtlib\Utils::checkTable('vtiger_import_queue')) {
    Severity: Minor
    Found in modules/Import/actions/Queue.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\Module' in method 'add'.
    Open

                'tabid' => \App\Module::getModuleId($request->getModule()),
    Severity: Minor
    Found in modules/Import/actions/Queue.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 'vtlib\Utils' in method 'removeForUser'.
    Open

            if (vtlib\Utils::checkTable('vtiger_import_queue')) {
    Severity: Minor
    Found in modules/Import/actions/Queue.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 'vtlib\Utils' in method 'getImportInfoById'.
    Open

            if (vtlib\Utils::checkTable('vtiger_import_queue')) {
    Severity: Minor
    Found in modules/Import/actions/Queue.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 'getImportInfoFromResult'.
    Open

                'default_values' => \App\Json::decode($rowData['default_values']),
    Severity: Minor
    Found in modules/Import/actions/Queue.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 'add'.
    Open

                'default_values' => \App\Json::encode($defaultValues),
    Severity: Minor
    Found in modules/Import/actions/Queue.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 "field_mapping" 4 times.
    Open

                'field_mapping' => \App\Json::encode($request->get('field_mapping')),
    Severity: Critical
    Found in modules/Import/actions/Queue.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 "merge_type" 4 times.
    Open

                'merge_type' => $request->get('merge_type'),
    Severity: Critical
    Found in modules/Import/actions/Queue.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 "merge_fields" 4 times.
    Open

                'merge_fields' => \App\Json::encode($request->get('merge_fields')),
    Severity: Critical
    Found in modules/Import/actions/Queue.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 "temp_status" 5 times.
    Open

                'temp_status' => $temp_status,
    Severity: Critical
    Found in modules/Import/actions/Queue.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 "importid" 5 times.
    Open

                App\Db::getInstance()->createCommand()->delete('vtiger_import_queue', ['importid' => $importId])->execute();
    Severity: Critical
    Found in modules/Import/actions/Queue.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 "tabid" 3 times.
    Open

                'tabid' => \App\Module::getModuleId($request->getModule()),
    Severity: Critical
    Found in modules/Import/actions/Queue.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 "userid" 5 times.
    Open

                'userid' => $user->getId(),
    Severity: Critical
    Found in modules/Import/actions/Queue.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 "default_values" 5 times.
    Open

            if ($request->get('default_values')) {
    Severity: Critical
    Found in modules/Import/actions/Queue.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_import_queue" 12 times.
    Open

            \App\Db::getInstance()->createCommand()->insert('vtiger_import_queue', [
    Severity: Critical
    Found in modules/Import/actions/Queue.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.

    Parameter $user has undeclared type \App\User (Did you mean class \Tests\App\User)
    Open

        public static function add(App\Request $request, App\User $user)
    Severity: Minor
    Found in modules/Import/actions/Queue.php by phan

    Call to method getId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

                App\Db::getInstance()->createCommand()->delete('vtiger_import_queue', ['userid' => $user->getId()])->execute();
    Severity: Critical
    Found in modules/Import/actions/Queue.php by phan

    Call to method getId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            $rowData = (new \App\Db\Query())->from('vtiger_import_queue')->where(['tabid' => \App\Module::getModuleId($module), 'userid' => $user->getId()])->one();
    Severity: Critical
    Found in modules/Import/actions/Queue.php by phan

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

            $rowData = (new \App\Db\Query())->from('vtiger_import_queue')->where(['tabid' => \App\Module::getModuleId($module), 'userid' => $user->getId()])->one();
    Severity: Critical
    Found in modules/Import/actions/Queue.php by phan

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

            $query = (new App\Db\Query())->from('vtiger_import_queue');
    Severity: Critical
    Found in modules/Import/actions/Queue.php by phan

    Argument 1 (mixed) is string but \Users_Privileges_Model::hasModulePermission() takes int defined at /code/modules/Users/models/Privileges.php:101
    Open

            if (!$currentUserPrivilegesModel->hasModulePermission($request->getModule())) {
    Severity: Minor
    Found in modules/Import/actions/Queue.php by phan

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

            \App\Db::getInstance()->createCommand()->insert('vtiger_import_queue', [
    Severity: Critical
    Found in modules/Import/actions/Queue.php by phan

    Parameter $user has undeclared type \App\User (Did you mean class \Tests\App\User)
    Open

        public static function getUserCurrentImportInfo(App\User $user)
    Severity: Minor
    Found in modules/Import/actions/Queue.php by phan

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

            App\Db::getInstance()->createCommand()->update('vtiger_import_queue', ['temp_status' => $tempStatus], ['importid' => $importId])->execute();
    Severity: Critical
    Found in modules/Import/actions/Queue.php by phan

    Parameter $user has undeclared type \App\User (Did you mean class \Tests\App\User)
    Open

        public static function getImportInfo($module, App\User $user)
    Severity: Minor
    Found in modules/Import/actions/Queue.php by phan

    Call to method getId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

                $rowData = (new App\Db\Query())->from('vtiger_import_queue')->where(['userid' => $user->getId()])->one();
    Severity: Critical
    Found in modules/Import/actions/Queue.php by phan

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

                App\Db::getInstance()->createCommand()->delete('vtiger_import_queue', ['userid' => $user->getId()])->execute();
    Severity: Critical
    Found in modules/Import/actions/Queue.php by phan

    Parameter $user has undeclared type \App\User (Did you mean class \Tests\App\User)
    Open

        public static function removeForUser(App\User $user)
    Severity: Minor
    Found in modules/Import/actions/Queue.php by phan

    Returning type null but getUserCurrentImportInfo() is declared to return array
    Open

            return null;
    Severity: Minor
    Found in modules/Import/actions/Queue.php by phan

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

                $rowData = (new App\Db\Query())->from('vtiger_import_queue')->where(['userid' => $user->getId()])->one();
    Severity: Critical
    Found in modules/Import/actions/Queue.php by phan

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

                $rowData = (new App\Db\Query())->from('vtiger_import_queue')->where(['importid' => $importId])->one();
    Severity: Critical
    Found in modules/Import/actions/Queue.php by phan

    Call to method getId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

                'userid' => $user->getId(),
    Severity: Critical
    Found in modules/Import/actions/Queue.php by phan

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

                App\Db::getInstance()->createCommand()->delete('vtiger_import_queue', ['importid' => $importId])->execute();
    Severity: Critical
    Found in modules/Import/actions/Queue.php by phan

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

        public static $IMPORT_STATUS_SCHEDULED = 1;
    Severity: Minor
    Found in modules/Import/actions/Queue.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

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

        public static $IMPORT_STATUS_RUNNING = 2;
    Severity: Minor
    Found in modules/Import/actions/Queue.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

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

            $currentUserPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
    Severity: Minor
    Found in modules/Import/actions/Queue.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

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

        public static $IMPORT_STATUS_COMPLETED = 4;
    Severity: Minor
    Found in modules/Import/actions/Queue.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

    Each class must be in a namespace of at least one level (a top-level vendor name)
    Open

    class Import_Queue_Action extends \App\Controller\Action

    The property $IMPORT_STATUS_COMPLETED is not named in camelCase.
    Open

    class Import_Queue_Action extends \App\Controller\Action
    {
        public static $IMPORT_STATUS_NONE = 0;
        public static $IMPORT_STATUS_SCHEDULED = 1;
        public static $IMPORT_STATUS_RUNNING = 2;
    Severity: Minor
    Found in modules/Import/actions/Queue.php by phpmd

    CamelCasePropertyName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name attributes.

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $IMPORT_STATUS_SCHEDULED is not named in camelCase.
    Open

    class Import_Queue_Action extends \App\Controller\Action
    {
        public static $IMPORT_STATUS_NONE = 0;
        public static $IMPORT_STATUS_SCHEDULED = 1;
        public static $IMPORT_STATUS_RUNNING = 2;
    Severity: Minor
    Found in modules/Import/actions/Queue.php by phpmd

    CamelCasePropertyName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name attributes.

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $IMPORT_STATUS_RUNNING is not named in camelCase.
    Open

    class Import_Queue_Action extends \App\Controller\Action
    {
        public static $IMPORT_STATUS_NONE = 0;
        public static $IMPORT_STATUS_SCHEDULED = 1;
        public static $IMPORT_STATUS_RUNNING = 2;
    Severity: Minor
    Found in modules/Import/actions/Queue.php by phpmd

    CamelCasePropertyName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name attributes.

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The class Import_Queue_Action is not named in CamelCase.
    Open

    class Import_Queue_Action extends \App\Controller\Action
    {
        public static $IMPORT_STATUS_NONE = 0;
        public static $IMPORT_STATUS_SCHEDULED = 1;
        public static $IMPORT_STATUS_RUNNING = 2;
    Severity: Minor
    Found in modules/Import/actions/Queue.php by phpmd

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

    The property $IMPORT_STATUS_NONE is not named in camelCase.
    Open

    class Import_Queue_Action extends \App\Controller\Action
    {
        public static $IMPORT_STATUS_NONE = 0;
        public static $IMPORT_STATUS_SCHEDULED = 1;
        public static $IMPORT_STATUS_RUNNING = 2;
    Severity: Minor
    Found in modules/Import/actions/Queue.php by phpmd

    CamelCasePropertyName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name attributes.

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $IMPORT_STATUS_HALTED is not named in camelCase.
    Open

    class Import_Queue_Action extends \App\Controller\Action
    {
        public static $IMPORT_STATUS_NONE = 0;
        public static $IMPORT_STATUS_SCHEDULED = 1;
        public static $IMPORT_STATUS_RUNNING = 2;
    Severity: Minor
    Found in modules/Import/actions/Queue.php by phpmd

    CamelCasePropertyName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name attributes.

    Example

    class ClassName {
        protected $property_name;
    }

    Source

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

            if (!$currentUserPrivilegesModel->hasModulePermission($request->getModule())) {

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

         */

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

                            $value = $uiTypeModel->getDBValue($value);

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

        {

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

         * @param \App\User $user

    Line exceeds 120 characters; contains 160 characters
    Open

            $rowData = (new \App\Db\Query())->from('vtiger_import_queue')->where(['tabid' => \App\Module::getModuleId($module), 'userid' => $user->getId()])->one();

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

        public static $IMPORT_STATUS_COMPLETED = 4;

    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

                'default_values' => \App\Json::encode($defaultValues),

    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

         * @param \App\User $user

    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 static function getImportInfoById($importId)

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

            if (vtlib\Utils::checkTable('vtiger_import_queue')) {

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

                if ($rowData) {

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

                    return self::getImportInfoFromResult($rowData);

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

        /** {@inheritdoc} */

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

        /** {@inheritdoc} */

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

        public static function remove($importId)

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

        public static function removeForUser(App\User $user)

    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 checkPermission(App\Request $request)

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

            $currentUserPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();

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

         * Adds status to the database.

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

         * Function to get current import.

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

                    return static::getImportInfoFromResult($rowData);

    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 null;

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

            return null;

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

        public function __construct()

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

        }

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

         * @param \App\User    $user

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

                    if ($fieldModel = $moduleModel->getFieldByName($fieldName)) {

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

                'merge_fields' => \App\Json::encode($request->get('merge_fields')),

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

        public static function getUserCurrentImportInfo(App\User $user)

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

                return self::getImportInfoFromResult($rowData);

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

            return null;

    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 ('reference' !== $fieldModel->getFieldDataType()) {

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

                    }

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

                'tabid' => \App\Module::getModuleId($request->getModule()),

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

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

        /**

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

                $moduleModel = Vtiger_Module_Model::getInstance($request->getModule());

    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

                $rowData = (new App\Db\Query())->from('vtiger_import_queue')->where(['userid' => $user->getId()])->one();

    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

        public static function add(App\Request $request, App\User $user)

    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 (vtlib\Utils::checkTable('vtiger_import_queue')) {

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

         * Remove import for user.

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

            if (vtlib\Utils::checkTable('vtiger_import_queue')) {

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

         * @param string    $module

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

         * @return array|null

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

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

        {

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

                throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);

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

            $defaultValues = [];

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

            if ($request->get('default_values')) {

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

        public static $IMPORT_STATUS_NONE = 0;

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

        {

    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

                            $uiTypeModel = $fieldModel->getUITypeModel();

    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

        public static $IMPORT_STATUS_SCHEDULED = 1;

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

        public function process(App\Request $request)

    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 array

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

            $rowData = (new \App\Db\Query())->from('vtiger_import_queue')->where(['tabid' => \App\Module::getModuleId($module), 'userid' => $user->getId()])->one();

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

        public static $IMPORT_STATUS_RUNNING = 2;

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

        {

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

                $temp_status = self::$IMPORT_STATUS_SCHEDULED;

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

                            $uiTypeModel->validate($value, true);

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

            \App\Db::getInstance()->createCommand()->insert('vtiger_import_queue', [

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

         * @param \App\User $user

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

            }

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

            $dataReader = $query->createCommand()->query();

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

        }

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

         * @param \App\Request $request

    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 ($request->get('is_scheduled')) {

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

                'field_mapping' => \App\Json::encode($request->get('field_mapping')),

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

                'merge_type' => $request->get('merge_type'),

    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

         *

    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 (vtlib\Utils::checkTable('vtiger_import_queue')) {

    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 static function getImportInfo($module, App\User $user)

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

                }

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

            $scheduledImports = [];

    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' => \App\Module::getModuleName($rowData['tabid']),

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

        public static $IMPORT_STATUS_HALTED = 3;

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

                foreach ($request->get('default_values') as $fieldName => $value) {

    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 [

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

                'user_id' => $rowData['userid'],

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

            ];

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

                $temp_status = self::$IMPORT_STATUS_NONE;

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

                App\Db::getInstance()->createCommand()->delete('vtiger_import_queue', ['importid' => $importId])->execute();

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

         */

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

                App\Db::getInstance()->createCommand()->delete('vtiger_import_queue', ['userid' => $user->getId()])->execute();

    Line exceeds 120 characters; contains 123 characters
    Open

                App\Db::getInstance()->createCommand()->delete('vtiger_import_queue', ['userid' => $user->getId()])->execute();

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

                $rowData = (new App\Db\Query())->from('vtiger_import_queue')->where(['importid' => $importId])->one();

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

            return $scheduledImports;

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

                'merge_type' => $rowData['merge_type'],

    Line exceeds 120 characters; contains 148 characters
    Open

            App\Db::getInstance()->createCommand()->update('vtiger_import_queue', ['temp_status' => $tempStatus], ['importid' => $importId])->execute();

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

            }

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

                        $defaultValues[$fieldName] = $value;

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

                'userid' => $user->getId(),

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

                'temp_status' => $temp_status,

    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

         * Import info.

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

        {

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

            $dataReader->close();

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

         * Import info.

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

                'field_mapping' => \App\Json::decode($rowData['field_mapping']),

    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 array

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

                'merge_fields' => \App\Json::decode($rowData['merge_fields']),

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

        public static function updateStatus($importId, $tempStatus)

    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

                $scheduledImports[$row['importid']] = self::getImportInfoFromResult($row);

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

                'id' => $rowData['importid'],

    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 static function getAll($tempStatus = false)

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

                'default_values' => \App\Json::decode($rowData['default_values']),

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

            $query = (new App\Db\Query())->from('vtiger_import_queue');

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

            if (false !== $tempStatus) {

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

        }

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

                $query->where(['temp_status' => $tempStatus]);

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

                'temp_status' => $rowData['temp_status'],

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

            App\Db::getInstance()->createCommand()->update('vtiger_import_queue', ['temp_status' => $tempStatus], ['importid' => $importId])->execute();

    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

            while ($row = $dataReader->read()) {

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

            }

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

         * @param array $rowData

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

        public static function getImportInfoFromResult($rowData)

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

        }

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

    class Import_Queue_Action extends \App\Controller\Action

    The variable $temp_status is not named in camelCase.
    Open

        public static function add(App\Request $request, App\User $user)
        {
            if ($request->get('is_scheduled')) {
                $temp_status = self::$IMPORT_STATUS_SCHEDULED;
            } else {
    Severity: Minor
    Found in modules/Import/actions/Queue.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $temp_status is not named in camelCase.
    Open

        public static function add(App\Request $request, App\User $user)
        {
            if ($request->get('is_scheduled')) {
                $temp_status = self::$IMPORT_STATUS_SCHEDULED;
            } else {
    Severity: Minor
    Found in modules/Import/actions/Queue.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $temp_status is not named in camelCase.
    Open

        public static function add(App\Request $request, App\User $user)
        {
            if ($request->get('is_scheduled')) {
                $temp_status = self::$IMPORT_STATUS_SCHEDULED;
            } else {
    Severity: Minor
    Found in modules/Import/actions/Queue.php by phpmd

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    There are no issues that match your filters.

    Category
    Status