YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/crons/AddressBook.php

Summary

Maintainability
C
1 day
Test Coverage
A
92%

Function process has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        \App\Log::trace('Start create AddressBook');

        $limit = App\Config::performance('CRON_MAX_NUMBERS_RECORD_ADDRESS_BOOK_UPDATER');
Severity: Minor
Found in modules/Vtiger/crons/AddressBook.php - About 6 hrs 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 process has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function process()
    {
        \App\Log::trace('Start create AddressBook');

        $limit = App\Config::performance('CRON_MAX_NUMBERS_RECORD_ADDRESS_BOOK_UPDATER');
Severity: Major
Found in modules/Vtiger/crons/AddressBook.php - About 3 hrs to fix

    The method process() has an NPath complexity of 9409. The configured NPath complexity threshold is 200.
    Open

        public function process()
        {
            \App\Log::trace('Start create AddressBook');
    
            $limit = App\Config::performance('CRON_MAX_NUMBERS_RECORD_ADDRESS_BOOK_UPDATER');
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.php by phpmd

    NPathComplexity

    Since: 0.1

    The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

    Example

    class Foo {
        function bar() {
            // lots of complicated code
        }
    }

    Source https://phpmd.org/rules/codesize.html#npathcomplexity

    The method process() has a Cyclomatic Complexity of 19. The configured cyclomatic complexity threshold is 10.
    Open

        public function process()
        {
            \App\Log::trace('Start create AddressBook');
    
            $limit = App\Config::performance('CRON_MAX_NUMBERS_RECORD_ADDRESS_BOOK_UPDATER');
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.php by phpmd

    CyclomaticComplexity

    Since: 0.1

    Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

    Example

    // Cyclomatic Complexity = 11
    class Foo {
    1   public function example() {
    2       if ($a == $b) {
    3           if ($a1 == $b1) {
                    fiddle();
    4           } elseif ($a2 == $b2) {
                    fiddle();
                } else {
                    fiddle();
                }
    5       } elseif ($c == $d) {
    6           while ($c == $d) {
                    fiddle();
                }
    7        } elseif ($e == $f) {
    8           for ($n = 0; $n < $h; $n++) {
                    fiddle();
                }
            } else {
                switch ($z) {
    9               case 1:
                        fiddle();
                        break;
    10              case 2:
                        fiddle();
                        break;
    11              case 3:
                        fiddle();
                        break;
                    default:
                        fiddle();
                        break;
                }
            }
        }
    }

    Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

    Refactor this function to reduce its Cognitive Complexity from 39 to the 15 allowed.
    Open

        public function process()
    Severity: Critical
    Found in modules/Vtiger/crons/AddressBook.php by sonar-php

    Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

    See

    Missing class import via use statement (line '33', column '21').
    Open

            $workflows = (new App\Db\Query())->select(['module_name', 'task'])->from('com_vtiger_workflows')
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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 '57', column '26').
    Open

                $queryGenerator = new App\QueryGenerator($moduleName, $currentUser->id);
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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\Config' in method 'process'.
    Open

            $limit = App\Config::performance('CRON_MAX_NUMBERS_RECORD_ADDRESS_BOOK_UPDATER');
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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 'process'.
    Open

                $metainfo = \App\Module::getEntityInfo($moduleName);
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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 'OSSMail_AddressBook_Model' in method 'process'.
    Open

                        OSSMail_AddressBook_Model::saveLastRecord($record, $moduleName);
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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 'OSSMail_AddressBook_Model' in method 'process'.
    Open

            OSSMail_AddressBook_Model::createABFile();
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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 'OSSMail_AddressBook_Model' in method 'process'.
    Open

            $last = OSSMail_AddressBook_Model::getLastRecord();
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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\Privilege' in method 'process'.
    Open

                        if (\App\Privilege::isPermitted($moduleName, 'DetailView', $record, $userId)) {
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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 'OSSMail_AddressBook_Model' in method 'process'.
    Open

                    OSSMail_AddressBook_Model::clearLastRecord();
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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 'process'.
    Open

            \App\Log::trace(App\Utils::varExport($i));
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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 'process'.
    Open

            \App\Log::trace(App\Utils::varExport($i));
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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 'process'.
    Open

            $db = \App\Db::getInstance();
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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 'process'.
    Open

                $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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 'process'.
    Open

            \App\Log::trace('Start create AddressBook');
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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 'process'.
    Open

            \App\Log::trace('End create AddressBook');
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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 'Users' in method 'process'.
    Open

            $currentUser = Users::getActiveAdminUser();
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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\Fields\Owner' in method 'process'.
    Open

            $usersIds = \App\Fields\Owner::getUsersIds();
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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 "module_name" 3 times.
    Open

            $workflows = (new App\Db\Query())->select(['module_name', 'task'])->from('com_vtiger_workflows')
    Severity: Critical
    Found in modules/Vtiger/crons/AddressBook.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 modules/Vtiger/crons/AddressBook.php by phan

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

                    $queryGenerator->addCondition('id', $last['record'], 'a');
    Severity: Critical
    Found in modules/Vtiger/crons/AddressBook.php by phan

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

            \App\Log::trace(App\Utils::varExport($i));
    Severity: Critical
    Found in modules/Vtiger/crons/AddressBook.php by phan

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

            $workflows = (new App\Db\Query())->select(['module_name', 'task'])->from('com_vtiger_workflows')
    Severity: Critical
    Found in modules/Vtiger/crons/AddressBook.php by phan

    Call to method getUsersIds from undeclared class \App\Fields\Owner
    Open

            $usersIds = \App\Fields\Owner::getUsersIds();
    Severity: Critical
    Found in modules/Vtiger/crons/AddressBook.php by phan

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

            \App\Log::trace('End create AddressBook');
    Severity: Critical
    Found in modules/Vtiger/crons/AddressBook.php by phan

    Suspicious array access to int|true
    Open

                    $queryGenerator->addCondition('id', $last['record'], 'a');
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.php by phan

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

                $query = $queryGenerator->createQuery();
    Severity: Critical
    Found in modules/Vtiger/crons/AddressBook.php by phan

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

                $queryGenerator = new App\QueryGenerator($moduleName, $currentUser->id);
    Severity: Critical
    Found in modules/Vtiger/crons/AddressBook.php by phan

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

                $queryGenerator->setFields($queryFields);
    Severity: Critical
    Found in modules/Vtiger/crons/AddressBook.php by phan

    Suspicious array access to int|true
    Open

                if (empty($task['active']) || (false !== $last && $last['module'] != $moduleName)) {
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.php by phan

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

            \App\Log::trace('Start create AddressBook');
    Severity: Critical
    Found in modules/Vtiger/crons/AddressBook.php by phan

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

    class Vtiger_AddressBook_Cron extends \App\CronHandler

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

            $i = ['rows' => [], 'users' => \count($usersIds)];
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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 $l. Configured minimum length is 3.
    Open

            $l = 0;
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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

    The class Vtiger_AddressBook_Cron is not named in CamelCase.
    Open

    class Vtiger_AddressBook_Cron extends \App\CronHandler
    {
        /** {@inheritdoc} */
        public function process()
        {
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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

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

            $db = \App\Db::getInstance();
    Severity: Minor
    Found in modules/Vtiger/crons/AddressBook.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

    Line exceeds 120 characters; contains 125 characters
    Open

                ->leftJoin('com_vtiger_workflowtasks', 'com_vtiger_workflowtasks.workflow_id = com_vtiger_workflows.workflow_id')

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

                $task = (array) unserialize($row['task']);

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

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

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

                        if (\App\Privilege::isPermitted($moduleName, 'DetailView', $record, $userId)) {

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

                    ++$l;

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

            \App\Log::trace(App\Utils::varExport($i));

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

        public function process()

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

            \App\Log::trace('Start create AddressBook');

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

            $workflows = (new App\Db\Query())->select(['module_name', 'task'])->from('com_vtiger_workflows')

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

                if (empty($task['active']) || (false !== $last && $last['module'] != $moduleName)) {

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

                $fields = $moduleModel->getFieldsByType('email', true);

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

                    foreach ($metainfo['fieldnameArr'] as $entityName) {

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

                }

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

                ->leftJoin('com_vtiger_workflowtasks', 'com_vtiger_workflowtasks.workflow_id = com_vtiger_workflows.workflow_id')

    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

                    $dbCommand->delete($table, ['id' => $record])->execute();

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

                $last = false;

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

            $limit = App\Config::performance('CRON_MAX_NUMBERS_RECORD_ADDRESS_BOOK_UPDATER');

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

                $queryGenerator->setFields($queryFields);

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

            }

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

            $table = OSSMail_AddressBook_Model::TABLE;

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

                $moduleName = $row['module_name'];

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

                $queryGenerator = new App\QueryGenerator($moduleName, $currentUser->id);

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

                    OSSMail_AddressBook_Model::clearLastRecord();

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

            $usersIds = \App\Fields\Owner::getUsersIds();

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

            $last = OSSMail_AddressBook_Model::getLastRecord();

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

                }

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

                $i['rows'][$moduleName] = 0;

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

                if (empty($fields)) {

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

                $query = $queryGenerator->createQuery();

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

                    $users = $name = '';

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

                $metainfo = \App\Module::getEntityInfo($moduleName);

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

                        $name .= ' ' . $row[$entityName];

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

                        unset($row[$entityName]);

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

                        if (!empty($row[$fieldName]) && !\in_array($row[$fieldName], $added)) {

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

                if (!$break && false !== $last) {

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

                    foreach ($emailFields as $fieldName) {

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

                    if ($limit == $l) {

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

                $emailFields = array_keys($fields);

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

                $queryFields = array_merge(['id'], $metainfo['fieldnameArr'], $emailFields);

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

                            $dbCommand->insert($table, ['id' => $record, 'email' => $row[$fieldName], 'name' => trim($name), 'users' => $users])->execute();

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

            $break = false;

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

            foreach ($workflows as $row) {

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

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

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

                    }

    Line exceeds 120 characters; contains 152 characters
    Open

                            $dbCommand->insert($table, ['id' => $record, 'email' => $row[$fieldName], 'name' => trim($name), 'users' => $users])->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

                        OSSMail_AddressBook_Model::saveLastRecord($record, $moduleName);

    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

            $dbCommand = $db->createCommand();

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

            $i = ['rows' => [], 'users' => \count($usersIds)];

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

            $l = 0;

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

                $emailCondition = ['or'];

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

                foreach ($emailFields as $fieldName) {

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

                    foreach ($usersIds as $userId) {

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

                        $break = true;

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

            OSSMail_AddressBook_Model::createABFile();

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

                $moduleModel = Vtiger_Module_Model::getInstance($moduleName);

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

                $this->updateLastActionTime();

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

                $query->andWhere($emailCondition)->limit($limit + 1);

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

                    $record = reset($row);

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

                        break;

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

            $db = \App\Db::getInstance();

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

                ->where(['like', 'task', 'VTAddressBookTask'])

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

                    $emailCondition[] = ['<>', $fieldName, ''];

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

                    $added = [];

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

                $dataReaderRows->close();

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

                    continue;

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

                    $queryGenerator->addCondition('id', $last['record'], 'a');

    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

            \App\Log::trace('End create AddressBook');

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

        }

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

            $currentUser = Users::getActiveAdminUser();

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

                    continue;

    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

                $dataReaderRows = $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

                    ++$i['rows'][$moduleName];

    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

                ->indexBy('module_name')->all();

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

                    continue;

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

                if (false !== $last) {

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

                            $users .= ',' . $userId;

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

                            $added[] = $row[$fieldName];

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

    class Vtiger_AddressBook_Cron extends \App\CronHandler

    There are no issues that match your filters.

    Category
    Status