YetiForceCompany/YetiForceCRM

View on GitHub
app/Db/Updater.php

Summary

Maintainability
B
5 hrs
Test Coverage
F
0%

Function addRoleToPicklist has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public static function addRoleToPicklist($fields): void
    {
        \App\Log::trace('Entering ' . __METHOD__);
        $db = \App\Db::getInstance();
        $schema = $db->getSchema();
Severity: Minor
Found in app/Db/Updater.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 addRoleToPicklist has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function addRoleToPicklist($fields): void
    {
        \App\Log::trace('Entering ' . __METHOD__);
        $db = \App\Db::getInstance();
        $schema = $db->getSchema();
Severity: Minor
Found in app/Db/Updater.php - About 1 hr to fix

    Function cron has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function cron($crons): array
        {
            if (!$crons) {
                return [];
            }
    Severity: Minor
    Found in app/Db/Updater.php - About 55 mins 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

    Function removeRoleToPicklist has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function removeRoleToPicklist($fields): void
        {
            \App\Log::trace('Entering ' . __METHOD__);
            $db = \App\Db::getInstance();
            $schema = $db->getSchema();
    Severity: Minor
    Found in app/Db/Updater.php - About 35 mins 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

    Function batchInsert has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function batchInsert($rows): array
        {
            $dbCommand = \App\Db::getInstance()->createCommand();
            $s = 0;
            foreach ($rows as $row) {
    Severity: Minor
    Found in app/Db/Updater.php - About 25 mins 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

    Missing class import via use statement (line '82', column '17').
    Open

            $query = (new \App\Db\Query())->from('vtiger_field')->where(['uitype' => 16])->andWhere(['fieldname' => $fields]);
    Severity: Minor
    Found in app/Db/Updater.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 '152', column '15').
    Open

                    throw new \App\Exceptions\DbException(\App\Utils::varExport(['tableName' => $row[0], 'columns' => $row[1], 'conditions' => $row[2] ?? null]) . PHP_EOL . $th->__toString(), $th->getCode());
    Severity: Minor
    Found in app/Db/Updater.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 '53', column '20').
    Open

                    $query2 = (new \App\Db\Query())->select([$identifier, 'sortorderid'])->from($picklistTable);
    Severity: Minor
    Found in app/Db/Updater.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 '37', column '17').
    Open

            $query = (new \App\Db\Query())->from('vtiger_field')
    Severity: Minor
    Found in app/Db/Updater.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 '207', column '21').
    Open

                $isExists = (new \App\Db\Query())->from('vtiger_cron_task')->where(['name' => $cronData[0], 'handler_class' => $cronData[1]])->exists();
    Severity: Minor
    Found in app/Db/Updater.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

                    if (!isset($row[2]) || !(new \App\db\Query())->from($row[0])->where($row[2])->exists()) {
    Severity: Minor
    Found in app/Db/Updater.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 '122', column '15').
    Open

                    throw new \App\Exceptions\DbException(\App\Utils::varExport(['tableName' => $row[0], 'columns' => $row[1], 'conditions' => $row[2] ?? null]) . PHP_EOL . $th->__toString(), $th->getCode());
    Severity: Minor
    Found in app/Db/Updater.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 '36', column '19').
    Open

            $roleIds = (new \App\Db\Query())->select(['roleid'])->from('vtiger_role')->column();
    Severity: Minor
    Found in app/Db/Updater.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 '179', column '15').
    Open

                    throw new \App\Exceptions\DbException(\App\Utils::varExport(['tableName' => $row[0], 'conditions' => $row[1] ?? null]) . PHP_EOL . $th->__toString(), $th->getCode());
    Severity: Minor
    Found in app/Db/Updater.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 '90', column '24').
    Open

                    $picklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $row['fieldname']])->scalar();
    Severity: Minor
    Found in app/Db/Updater.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 '48', column '27').
    Open

                    $newPicklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $row['fieldname']])->scalar();
    Severity: Minor
    Found in app/Db/Updater.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Avoid using static access to class '\App\Utils' in method 'batchDelete'.
    Open

                    throw new \App\Exceptions\DbException(\App\Utils::varExport(['tableName' => $row[0], 'conditions' => $row[1] ?? null]) . PHP_EOL . $th->__toString(), $th->getCode());
    Severity: Minor
    Found in app/Db/Updater.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\Utils' in method 'batchInsert'.
    Open

                    throw new \App\Exceptions\DbException(\App\Utils::varExport(['tableName' => $row[0], 'columns' => $row[1], 'conditions' => $row[2] ?? null]) . PHP_EOL . $th->__toString(), $th->getCode());
    Severity: Minor
    Found in app/Db/Updater.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\Utils' in method 'batchUpdate'.
    Open

                    throw new \App\Exceptions\DbException(\App\Utils::varExport(['tableName' => $row[0], 'columns' => $row[1], 'conditions' => $row[2] ?? null]) . PHP_EOL . $th->__toString(), $th->getCode());
    Severity: Minor
    Found in app/Db/Updater.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\Cron' in method 'cron'.
    Open

                    \vtlib\Cron::register($cronData[0], $cronData[1], $cronData[2], $cronData[6], $cronData[5], 0, $cronData[8]);
    Severity: Minor
    Found in app/Db/Updater.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\Cron' in method 'cron'.
    Open

                    \vtlib\Cron::deregister($cronData[0]);
    Severity: Minor
    Found in app/Db/Updater.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\Log' in method 'cron'.
    Open

            \App\Log::trace('Entering ' . __METHOD__);
    Severity: Minor
    Found in app/Db/Updater.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\Log' in method 'cron'.
    Open

            \App\Log::trace('Exiting ' . __METHOD__);
    Severity: Minor
    Found in app/Db/Updater.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\Log' in method 'removeRoleToPicklist'.
    Open

            \App\Log::trace('Entering ' . __METHOD__);
    Severity: Minor
    Found in app/Db/Updater.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\Log' in method 'removeRoleToPicklist'.
    Open

            \App\Log::trace('Exiting ' . __METHOD__);
    Severity: Minor
    Found in app/Db/Updater.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\Log' in method 'addRoleToPicklist'.
    Open

            \App\Log::trace('Exiting ' . __METHOD__);
    Severity: Minor
    Found in app/Db/Updater.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\Log' in method 'addRoleToPicklist'.
    Open

            \App\Log::trace('Entering ' . __METHOD__);
    Severity: Minor
    Found in app/Db/Updater.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

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

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

            $db = \App\Db::getInstance();
    Severity: Minor
    Found in app/Db/Updater.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

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

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

            $db = \App\Db::getInstance();
    Severity: Minor
    Found in app/Db/Updater.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 "picklist_valueid" 5 times.
    Open

                if ($tableSchema && !isset($tableSchema->columns['picklist_valueid'])) {
    Severity: Critical
    Found in app/Db/Updater.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_field" 4 times.
    Open

            $query = (new \App\Db\Query())->from('vtiger_field')
    Severity: Critical
    Found in app/Db/Updater.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 "Exiting " 3 times.
    Open

            \App\Log::trace('Exiting ' . __METHOD__);
    Severity: Critical
    Found in app/Db/Updater.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 "affected" 3 times.
    Open

            return ['affected' => $s, 'all' => \count($rows)];
    Severity: Critical
    Found in app/Db/Updater.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 "picklistid" 4 times.
    Open

                    $newPicklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $row['fieldname']])->scalar();
    Severity: Critical
    Found in app/Db/Updater.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 "tableName" 3 times.
    Open

                    throw new \App\Exceptions\DbException(\App\Utils::varExport(['tableName' => $row[0], 'columns' => $row[1], 'conditions' => $row[2] ?? null]) . PHP_EOL . $th->__toString(), $th->getCode());
    Severity: Critical
    Found in app/Db/Updater.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 "uitype" 4 times.
    Open

                ->where(['uitype' => 16])
    Severity: Critical
    Found in app/Db/Updater.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 "fieldname" 9 times.
    Open

                ->andWhere(['fieldname' => $fields]);
    Severity: Critical
    Found in app/Db/Updater.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 "Entering " 3 times.
    Open

            \App\Log::trace('Entering ' . __METHOD__);
    Severity: Critical
    Found in app/Db/Updater.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_picklist" 4 times.
    Open

                    $dbCommand->insert('vtiger_picklist', ['name' => $row['fieldname']])->execute();
    Severity: Critical
    Found in app/Db/Updater.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 "fieldid" 4 times.
    Open

                    $dbCommand->update('vtiger_field', ['uitype' => 15], ['fieldid' => $row['fieldid']])->execute();
    Severity: Critical
    Found in app/Db/Updater.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 "conditions" 3 times.
    Open

                    throw new \App\Exceptions\DbException(\App\Utils::varExport(['tableName' => $row[0], 'columns' => $row[1], 'conditions' => $row[2] ?? null]) . PHP_EOL . $th->__toString(), $th->getCode());
    Severity: Critical
    Found in app/Db/Updater.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 \App\Db::createCommand
    Open

            $dbCommand = $db->createCommand();
    Severity: Critical
    Found in app/Db/Updater.php by phan

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

            $schema = $db->getSchema();
    Severity: Critical
    Found in app/Db/Updater.php by phan

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

                    $query2 = (new \App\Db\Query())->select([$identifier, 'sortorderid'])->from($picklistTable);
    Severity: Critical
    Found in app/Db/Updater.php by phan

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

            $dbCommand = \App\Db::getInstance()->createCommand();
    Severity: Critical
    Found in app/Db/Updater.php by phan

    Call to method trace from undeclared class \App\Log
    Open

            \App\Log::trace('Exiting ' . __METHOD__);
    Severity: Critical
    Found in app/Db/Updater.php by phan

    Call to method trace from undeclared class \App\Log
    Open

            \App\Log::trace('Exiting ' . __METHOD__);
    Severity: Critical
    Found in app/Db/Updater.php by phan

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

            $roleIds = (new \App\Db\Query())->select(['roleid'])->from('vtiger_role')->column();
    Severity: Critical
    Found in app/Db/Updater.php by phan

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

                    $picklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $row['fieldname']])->scalar();
    Severity: Critical
    Found in app/Db/Updater.php by phan

    Reference to constant TYPE_INTEGER from undeclared class \yii\db\Schema (Did you mean class \App\Db\Drivers\Mysql\Schema or class \App\Db\Drivers\Pgsql\Schema)
    Open

                    $dbCommand->addColumn($picklistTable, 'picklist_valueid', $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_INTEGER, 10)->notNull()->defaultValue(0))->execute();
    Severity: Critical
    Found in app/Db/Updater.php by phan

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

                    $newPicklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $row['fieldname']])->scalar();
    Severity: Critical
    Found in app/Db/Updater.php by phan

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

            $query = (new \App\Db\Query())->from('vtiger_field')->where(['uitype' => 16])->andWhere(['fieldname' => $fields]);
    Severity: Critical
    Found in app/Db/Updater.php by phan

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

            $query = (new \App\Db\Query())->from('vtiger_field')
    Severity: Critical
    Found in app/Db/Updater.php by phan

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

            $dbCommand = $db->createCommand();
    Severity: Critical
    Found in app/Db/Updater.php by phan

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

            $schema = $db->getSchema();
    Severity: Critical
    Found in app/Db/Updater.php by phan

    Argument 5 (status) is string but \vtlib\Cron::register() takes int defined at /code/vtlib/Vtiger/Cron.php:398
    Open

                    \vtlib\Cron::register($cronData[0], $cronData[1], $cronData[2], $cronData[6], $cronData[5], 0, $cronData[8]);
    Severity: Minor
    Found in app/Db/Updater.php by phan

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

            $dbCommand = \App\Db::getInstance()->createCommand();
    Severity: Critical
    Found in app/Db/Updater.php by phan

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

                    if (!isset($row[2]) || !(new \App\db\Query())->from($row[0])->where($row[2])->exists()) {
    Severity: Critical
    Found in app/Db/Updater.php by phan

    Call to method trace from undeclared class \App\Log
    Open

            \App\Log::trace('Entering ' . __METHOD__);
    Severity: Critical
    Found in app/Db/Updater.php by phan

    Call to method trace from undeclared class \App\Log
    Open

            \App\Log::trace('Entering ' . __METHOD__);
    Severity: Critical
    Found in app/Db/Updater.php by phan

    Argument 3 (frequency) is string but \vtlib\Cron::register() takes int defined at /code/vtlib/Vtiger/Cron.php:398
    Open

                    \vtlib\Cron::register($cronData[0], $cronData[1], $cronData[2], $cronData[6], $cronData[5], 0, $cronData[8]);
    Severity: Minor
    Found in app/Db/Updater.php by phan

    Suspicious array access to ?mixed
    Open

                    throw new \App\Exceptions\DbException(\App\Utils::varExport(['tableName' => $row[0], 'columns' => $row[1], 'conditions' => $row[2] ?? null]) . PHP_EOL . $th->__toString(), $th->getCode());
    Severity: Minor
    Found in app/Db/Updater.php by phan

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

                $isExists = (new \App\Db\Query())->from('vtiger_cron_task')->where(['name' => $cronData[0], 'handler_class' => $cronData[1]])->exists();
    Severity: Critical
    Found in app/Db/Updater.php by phan

    Call to method trace from undeclared class \App\Log
    Open

            \App\Log::trace('Entering ' . __METHOD__);
    Severity: Critical
    Found in app/Db/Updater.php by phan

    When fetching an array index from a value of type string, found an array index of type 'type', but expected the index to be of type int
    Open

                if (!$isExists && 'add' === $cron['type']) {
    Severity: Minor
    Found in app/Db/Updater.php by phan

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

            $dbCommand = \App\Db::getInstance()->createCommand();
    Severity: Critical
    Found in app/Db/Updater.php by phan

    When fetching an array index from a value of type string, found an array index of type 'type', but expected the index to be of type int
    Open

                } elseif ($isExists && 'remove' === $cron['type']) {
    Severity: Minor
    Found in app/Db/Updater.php by phan

    Call to method trace from undeclared class \App\Log
    Open

            \App\Log::trace('Exiting ' . __METHOD__);
    Severity: Critical
    Found in app/Db/Updater.php by phan

    Suspicious array access to ?mixed
    Open

                        $dbCommand->insert($row[0], $row[1])->execute();
    Severity: Minor
    Found in app/Db/Updater.php by phan

    When fetching an array index from a value of type string, found an array index of type 'data', but expected the index to be of type int
    Open

                $cronData = $cron['data'];
    Severity: Minor
    Found in app/Db/Updater.php by phan

    Avoid variables with short names like $s. Configured minimum length is 3.
    Open

            $s = 0;
    Severity: Minor
    Found in app/Db/Updater.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

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

    Avoid variables with short names like $s. Configured minimum length is 3.
    Open

            $s = 0;
    Severity: Minor
    Found in app/Db/Updater.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

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

    Avoid variables with short names like $s. Configured minimum length is 3.
    Open

            $s = 0;
    Severity: Minor
    Found in app/Db/Updater.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

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

    Avoid variables with short names like $db. Configured minimum length is 3.
    Open

            $db = \App\Db::getInstance();
    Severity: Minor
    Found in app/Db/Updater.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

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

    Avoid variables with short names like $db. Configured minimum length is 3.
    Open

            $db = \App\Db::getInstance();
    Severity: Minor
    Found in app/Db/Updater.php by phpmd

    ShortVariable

    Since: 0.2

    Detects when a field, local, or parameter has a very short name.

    Example

    class Something {
        private $q = 15; // VIOLATION - Field
        public static function main( array $as ) { // VIOLATION - Formal
            $r = 20 + $this->q; // VIOLATION - Local
            for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                $r += $this->q;
            }
        }
    }

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

    Spaces must be used for alignment; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * Batch insert rows.
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        public static function batchDelete($rows): array
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * @param array $rows
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            foreach ($rows as $row) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *     ['type' => 'add', 'data' => ['LBL_BROWSING_HISTORY', 'cron/BrowsingHistory.php', 86400, NULL, NULL, 1, NULL, 29, NULL]],
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            if (!$crons) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                    continue;
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                    $cronAction[] = $cronData[0];
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * ];
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            foreach ($rows as $row) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                        ++$s;
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * @param array $rows
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                    $s += $dbCommand->delete($row[0], $row[1])->execute();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                    throw new \App\Exceptions\DbException(\App\Utils::varExport(['tableName' => $row[0], 'columns' => $row[1], 'conditions' => $row[2] ?? null]) . PHP_EOL . $th->__toString(), $th->getCode());
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *    ['vtiger_cvcolumnlist', ['cvid' => 43, 'columnindex' => 5, 'columnname' => 'cc'], ],
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            $dbCommand = \App\Db::getInstance()->createCommand();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            $s = 0;
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            $s = 0;
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            return ['affected' => $s, 'all' => \count($rows)];
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * @return int[]
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        public static function batchUpdate($rows): array
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            foreach ($rows as $row) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * @return int[]
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                    if (!isset($row[2]) || !(new \App\db\Query())->from($row[0])->where($row[2])->exists()) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *     ['vtiger_cvcolumnlist', ['cvid' => 43]],
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * ];
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                $isExists = (new \App\Db\Query())->from('vtiger_cron_task')->where(['name' => $cronData[0], 'handler_class' => $cronData[1]])->exists();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                    throw new \App\Exceptions\DbException(\App\Utils::varExport(['tableName' => $row[0], 'columns' => $row[1], 'conditions' => $row[2] ?? null]) . PHP_EOL . $th->__toString(), $th->getCode());
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * $crons = [
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            $s = 0;
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * ];
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * Batch insert rows.
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            $dbCommand = \App\Db::getInstance()->createCommand();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                if (!$isExists && 'add' === $cron['type']) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *    ['u_#__squotes_invfield', ['colspan' => 25], ['id' => 1]],
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                } catch (\Throwable $th) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                        $dbCommand->insert($row[0], $row[1])->execute();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        public static function cron($crons): array
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                } elseif ($isExists && 'remove' === $cron['type']) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                    \vtlib\Cron::deregister($cronData[0]);
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * @param array $rows
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * $rows = [
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                } catch (\Throwable $th) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            return ['affected' => $s, 'all' => \count($rows)];
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * $rows = [
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *      ['table name', [ update ], [ condition ],
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * @throws \App\Exceptions\DbException
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * @throws \App\Exceptions\DbException
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                    throw new \App\Exceptions\DbException(\App\Utils::varExport(['tableName' => $row[0], 'conditions' => $row[1] ?? null]) . PHP_EOL . $th->__toString(), $th->getCode());
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * @throws \App\Exceptions\DbException
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * ];
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            $dbCommand = \App\Db::getInstance()->createCommand();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            \App\Log::trace('Entering ' . __METHOD__);
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            $cronAction = [];
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            return ['affected' => $s, 'all' => \count($rows)];
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            foreach ($crons as $cron) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        /**
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        public static function batchInsert($rows): array
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *     ['type' => 'remove', 'data' => ['LBL_BATCH_PROCESSES']],
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * @param string[] $crons
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                    $s += $dbCommand->update($row[0], $row[1], $row[2] ?? '')->execute();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

        {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                    }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                try {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * Function to add and remove cron.
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                if (empty($cron)) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            return $cronAction;
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         *
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         */
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

         * @return int[]
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                $cronData = $cron['data'];
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                try {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                } catch (\Throwable $th) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                    \vtlib\Cron::register($cronData[0], $cronData[1], $cronData[2], $cronData[6], $cronData[5], 0, $cronData[8]);
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

            \App\Log::trace('Exiting ' . __METHOD__);
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                try {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Spaces must be used for alignment; tabs are not allowed
    Open

                return [];
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

        public static function addRoleToPicklist($fields): void
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            \App\Log::trace('Entering ' . __METHOD__);
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                        $newPicklistValueId = $db->getUniqueID('vtiger_picklistvalues');
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Line exceeds 120 characters; contains 149 characters
    Open

                        $dbCommand->batchInsert('vtiger_role2picklist', ['roleid', 'picklistvalueid', 'picklistid', 'sortid'], $insertedData)->execute();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                ->andWhere(['fieldname' => $fields]);
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                $picklistTable = 'vtiger_' . $row['fieldname'];
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                    $dataReader2 = $query2->createCommand()->query();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

        public static function removeRoleToPicklist($fields): void
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

         * Function used to change picklist type field (uitype 16) to field with permissions based on role (uitype 15).
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            $dataReader = $query->createCommand()->query();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            \App\Log::trace('Entering ' . __METHOD__);
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            $dataReader = $query->createCommand()->query();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

         * @param array $fields
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                        $newPicklistId = $db->getLastInsertID('vtiger_picklist_picklistid_seq');
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            while ($row = $dataReader->read()) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                $picklistTable = 'vtiger_' . $row['fieldname'];
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Line exceeds 120 characters; contains 149 characters
    Open

                    $picklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $row['fieldname']])->scalar();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            $db = \App\Db::getInstance();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            $dbCommand = $db->createCommand();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                $tableSchema = $schema->getTableSchema($picklistTable);
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                    $dbCommand->addColumn($picklistTable, 'picklist_valueid', $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_INTEGER, 10)->notNull()->defaultValue(0))->execute();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Line exceeds 120 characters; contains 155 characters
    Open

                        $dbCommand->update($picklistTable, ['picklist_valueid' => $newPicklistValueId], [$identifier => $picklistRow[$identifier]])->execute();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            $query = (new \App\Db\Query())->from('vtiger_field')->where(['uitype' => 16])->andWhere(['fieldname' => $fields]);
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

         *     'osstimecontrol_status',
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                    $dbCommand->insert('vtiger_picklist', ['name' => $row['fieldname']])->execute();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                    }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                        $insertedData = [];
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                        foreach ($roleIds as $value) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            \App\Log::trace('Exiting ' . __METHOD__);
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            $db = \App\Db::getInstance();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                if ($tableSchema && isset($tableSchema->columns['picklist_valueid'])) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            $roleIds = (new \App\Db\Query())->select(['roleid'])->from('vtiger_role')->column();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            while ($row = $dataReader->read()) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

         * $fields = [
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

         * Function used to change picklist type field (uitype 15 to 16).
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                    $picklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $row['fieldname']])->scalar();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                    $dbCommand->dropColumn($picklistTable, 'picklist_valueid')->execute();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            $query = (new \App\Db\Query())->from('vtiger_field')
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                if ($tableSchema && !isset($tableSchema->columns['picklist_valueid'])) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                    if (!$newPicklistId) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                        }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                    $query2 = (new \App\Db\Query())->select([$identifier, 'sortorderid'])->from($picklistTable);
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                        $dbCommand->update($picklistTable, ['picklist_valueid' => $newPicklistValueId], [$identifier => $picklistRow[$identifier]])->execute();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                    $dbCommand->update('vtiger_field', ['uitype' => 15], ['fieldid' => $row['fieldid']])->execute();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

         *     'fieldName',
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Line exceeds 120 characters; contains 183 characters
    Open

                    $dbCommand->addColumn($picklistTable, 'picklist_valueid', $schema->createColumnSchemaBuilder(\yii\db\Schema::TYPE_INTEGER, 10)->notNull()->defaultValue(0))->execute();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Line exceeds 120 characters; contains 152 characters
    Open

                    $newPicklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $row['fieldname']])->scalar();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                    $identifier = $row['fieldname'] . 'id';
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            $dbCommand = $db->createCommand();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Line exceeds 120 characters; contains 122 characters
    Open

            $query = (new \App\Db\Query())->from('vtiger_field')->where(['uitype' => 16])->andWhere(['fieldname' => $fields]);
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            $schema = $db->getSchema();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                    if ($picklistId) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                    $newPicklistId = (new \App\Db\Query())->select(['picklistid'])->from('vtiger_picklist')->where(['name' => $row['fieldname']])->scalar();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

         * @param string[] $fields List of field names
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                    $dbCommand->update('vtiger_field', ['uitype' => 15], ['fieldid' => $row['fieldid']])->execute();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                            $insertedData[] = [$value, $newPicklistValueId, $newPicklistId, $picklistRow['sortorderid']];
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                        $dbCommand->batchInsert('vtiger_role2picklist', ['roleid', 'picklistvalueid', 'picklistid', 'sortid'], $insertedData)->execute();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

         * ];
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                ->where(['uitype' => 16])
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                    }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            $schema = $db->getSchema();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                    while ($picklistRow = $dataReader2->read()) {
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                $tableSchema = $schema->getTableSchema($picklistTable);
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Line exceeds 120 characters; contains 131 characters
    Open

         *     ['type' => 'add', 'data' => ['LBL_BROWSING_HISTORY', 'cron/BrowsingHistory.php', 86400, NULL, NULL, 1, NULL, 29, NULL]],
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Line exceeds 120 characters; contains 125 characters
    Open

                    \vtlib\Cron::register($cronData[0], $cronData[1], $cronData[2], $cronData[6], $cronData[5], 0, $cronData[8]);
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

         *      ['table name', [ update ], [ condition ],
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Line exceeds 120 characters; contains 182 characters
    Open

                    throw new \App\Exceptions\DbException(\App\Utils::varExport(['tableName' => $row[0], 'conditions' => $row[1] ?? null]) . PHP_EOL . $th->__toString(), $th->getCode());
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                        $dbCommand->delete('vtiger_picklist', ['name' => $row['fieldname']])->execute();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                        $dbCommand->delete('vtiger_role2picklist', ['picklistid' => $picklistId])->execute();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

            \App\Log::trace('Exiting ' . __METHOD__);
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Line exceeds 120 characters; contains 204 characters
    Open

                    throw new \App\Exceptions\DbException(\App\Utils::varExport(['tableName' => $row[0], 'columns' => $row[1], 'conditions' => $row[2] ?? null]) . PHP_EOL . $th->__toString(), $th->getCode());
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Line exceeds 120 characters; contains 148 characters
    Open

                $isExists = (new \App\Db\Query())->from('vtiger_cron_task')->where(['name' => $cronData[0], 'handler_class' => $cronData[1]])->exists();
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                    }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

         * Batch update rows.
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

         * $rows = [
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    Line exceeds 120 characters; contains 204 characters
    Open

                    throw new \App\Exceptions\DbException(\App\Utils::varExport(['tableName' => $row[0], 'columns' => $row[1], 'conditions' => $row[2] ?? null]) . PHP_EOL . $th->__toString(), $th->getCode());
    Severity: Minor
    Found in app/Db/Updater.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status