YetiForceCompany/YetiForceCRM

View on GitHub
modules/HelpDesk/workflows/HelpDeskWorkflow.php

Summary

Maintainability
B
5 hrs
Test Coverage
F
0%

Function helpDeskNewCommentOwner has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public static function helpDeskNewCommentOwner(Vtiger_Record_Model $recordModel)
    {
        \App\Log::trace('Entering helpDeskNewCommentOwner');
        $relatedToId = $recordModel->get('related_to');
        $result = (new \App\Db\Query())->select(['smownerid'])->from('vtiger_crmentity')->where(['deleted' => 0, 'crmid' => $relatedToId])->scalar();
Severity: Minor
Found in modules/HelpDesk/workflows/HelpDeskWorkflow.php - About 2 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 helpDeskNewCommentOwner has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function helpDeskNewCommentOwner(Vtiger_Record_Model $recordModel)
    {
        \App\Log::trace('Entering helpDeskNewCommentOwner');
        $relatedToId = $recordModel->get('related_to');
        $result = (new \App\Db\Query())->select(['smownerid'])->from('vtiger_crmentity')->where(['deleted' => 0, 'crmid' => $relatedToId])->scalar();
Severity: Minor
Found in modules/HelpDesk/workflows/HelpDeskWorkflow.php - About 1 hr to fix

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

        public static function helpDeskNewCommentOwner(Vtiger_Record_Model $recordModel)

    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 '127', column '18').
    Open

            $result = (new \App\Db\Query())->select(['smownerid'])->from('vtiger_crmentity')->where(['deleted' => 0, 'crmid' => $relatedToId])->scalar();

    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 '20', column '25').
    Open

            $queryGenerator = new \App\QueryGenerator('Contacts');

    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 '86', column '17').
    Open

                $mail = (new \App\Db\Query())->select(['vtiger_account.email1'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_crmentity.crmid = vtiger_account.accountid')->innerJoin('vtiger_troubletickets', 'vtiger_troubletickets.parent_id = vtiger_account.accountid')->where(['vtiger_crmentity.deleted' => 0, 'vtiger_troubletickets.ticketid' => $relatedToId, 'vtiger_account.emailoptout' => 1])->scalar();

    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 assigning values to variables in if clauses and the like (line '107', column '101').
    Open

        public static function helpDeskNewCommentContacts(Vtiger_Record_Model $recordModel)
        {
            \App\Log::trace('Entering helpDeskNewCommentContacts');
            if (($relId = $recordModel->get('related_to')) && 'HelpDesk' === \App\Record::getType($relId) && ($mails = static::getContactsMailsFromTicket($relId))) {
                \App\Mailer::sendFromTemplate([

    IfStatementAssignment

    Since: 2.7.0

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

    Example

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

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

    The method helpDeskNewCommentOwner uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                } else {
                    $groupUsers = \App\PrivilegeUtil::getUsersByGroup($smownerId);
                    foreach ($groupUsers as $userId) {
                        $user = App\User::getUserModel($userId);
                        if (1 === (int) $user->getDetail('emailoptout')) {

    ElseExpression

    Since: 1.4.0

    An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($flag) {
                // one branch
            } else {
                // another branch
            }
        }
    }

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

    Avoid using static access to class 'App\User' in method 'helpDeskNewCommentOwner'.
    Open

                        $user = App\User::getUserModel($userId);

    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\Mailer' in method 'helpDeskChangeNotifyContacts'.
    Open

                \App\Mailer::sendFromTemplate([
                    'template' => 'NotifyContactOnTicketChange',
                    'moduleName' => 'HelpDesk',
                    'recordId' => $recordId,
                    'to' => $mails,

    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 'helpDeskNewCommentOwner'.
    Open

                $ownerType = \App\Fields\Owner::getType($smownerId);

    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\Mailer' in method 'helpDeskNewCommentAccount'.
    Open

                \App\Mailer::sendFromTemplate([
                    'template' => 'NewCommentAddedToTicketAccount',
                    'moduleName' => 'ModComments',
                    'recordId' => $recordModel->getId(),
                    'to' => $mail,

    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 'helpDeskChangeNotifyContacts'.
    Open

            \App\Log::trace('Entering helpDeskChangeNotifyContacts');

    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 'helpDeskChangeNotifyContacts'.
    Open

            \App\Log::trace('helpDeskChangeNotifyContacts');

    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 'helpDeskClosedNotifyContacts'.
    Open

            \App\Log::trace('Entering helpDeskClosedNotifyContacts');

    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 'helpDeskNewCommentContacts'.
    Open

            \App\Log::trace('helpDeskNewCommentContacts');

    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 'helpDeskNewCommentOwner'.
    Open

            \App\Log::trace('helpDeskNewCommentOwner');

    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\Mailer' in method 'helpDeskClosedNotifyContacts'.
    Open

                \App\Mailer::sendFromTemplate([
                    'template' => 'NotifyContactOnTicketClosed',
                    'moduleName' => 'HelpDesk',
                    'recordId' => $recordId,
                    'to' => $mails,

    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 'helpDeskClosedNotifyContacts'.
    Open

            \App\Log::trace('helpDeskClosedNotifyContacts');

    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\User' in method 'helpDeskNewCommentOwner'.
    Open

                    $user = App\User::getUserModel($smownerId);

    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 'helpDeskNewCommentAccount'.
    Open

            \App\Log::trace('Entering helpDeskNewCommentAccount');

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid assigning values to variables in if clauses and the like (line '107', column '8').
    Open

        public static function helpDeskNewCommentContacts(Vtiger_Record_Model $recordModel)
        {
            \App\Log::trace('Entering helpDeskNewCommentContacts');
            if (($relId = $recordModel->get('related_to')) && 'HelpDesk' === \App\Record::getType($relId) && ($mails = static::getContactsMailsFromTicket($relId))) {
                \App\Mailer::sendFromTemplate([

    IfStatementAssignment

    Since: 2.7.0

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

    Example

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

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

    Avoid using static access to class '\App\Mailer' in method 'helpDeskNewCommentContacts'.
    Open

                \App\Mailer::sendFromTemplate([
                    'template' => 'NewCommentAddedToTicketContact',
                    'moduleName' => 'ModComments',
                    'recordId' => $recordModel->getId(),
                    'to' => $mails,

    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 'helpDeskNewCommentOwner'.
    Open

            \App\Log::trace('Entering helpDeskNewCommentOwner');

    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\Mailer' in method 'helpDeskNewCommentOwner'.
    Open

                    \App\Mailer::sendFromTemplate([
                        'template' => 'NewCommentAddedToTicketOwner',
                        'moduleName' => 'ModComments',
                        'recordId' => $recordModel->getId(),
                        'to' => $mails,

    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 'helpDeskNewCommentAccount'.
    Open

            \App\Log::trace('helpDeskNewCommentAccount');

    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\Record' in method 'helpDeskNewCommentContacts'.
    Open

            if (($relId = $recordModel->get('related_to')) && 'HelpDesk' === \App\Record::getType($relId) && ($mails = static::getContactsMailsFromTicket($relId))) {

    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\Config' in method 'getContactsMailsFromTicket'.
    Open

            if (App\Config::module('HelpDesk', 'CONTACTS_CHECK_EMAIL_OPTOUT')) {

    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\Record' in method 'helpDeskNewCommentAccount'.
    Open

            $moduleName = \App\Record::getType($relatedToId);

    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 'helpDeskNewCommentContacts'.
    Open

            \App\Log::trace('Entering helpDeskNewCommentContacts');

    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\PrivilegeUtil' in method 'helpDeskNewCommentOwner'.
    Open

                    $groupUsers = \App\PrivilegeUtil::getUsersByGroup($smownerId);

    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 "template" 5 times.
    Open

                    'template' => 'NotifyContactOnTicketChange',

    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 "emailoptout" 3 times.
    Open

                $queryGenerator->addCondition('emailoptout', 1, 'e');

    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 "HelpDesk" 6 times.
    Open

            $queryGenerator->addNativeCondition(['and', ['vtiger_crmentityrel.crmid' => $id], ['vtiger_crmentityrel.module' => 'HelpDesk']]);

    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 "moduleName" 5 times.
    Open

                    'moduleName' => 'HelpDesk',

    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 "ModComments" 3 times.
    Open

                    'moduleName' => 'ModComments',

    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 "related_to" 3 times.
    Open

            $relatedToId = $recordModel->get('related_to');

    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 "recordId" 5 times.
    Open

                    'recordId' => $recordId,

    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 method getColumnName from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
    Open

            $queryGenerator->addJoin(['INNER JOIN', 'vtiger_crmentityrel', $queryGenerator->getColumnName('id') . '=vtiger_crmentityrel.relcrmid']);

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

            $queryGenerator->addJoin(['INNER JOIN', 'vtiger_crmentityrel', $queryGenerator->getColumnName('id') . '=vtiger_crmentityrel.relcrmid']);

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

            $queryGenerator->setFields(['email']);

    Reference to instance property permissions from undeclared class \App\QueryGenerator
    Open

            $queryGenerator->permissions = false;

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

                $queryGenerator->addCondition('emailoptout', 1, 'e');

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

            \App\Log::trace('Entering helpDeskClosedNotifyContacts');

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

            \App\Log::trace('Entering helpDeskNewCommentContacts');

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

            \App\Log::trace('helpDeskNewCommentOwner');

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

            $queryGenerator->addCondition('email', '', 'ny');

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

            $queryGenerator = new \App\QueryGenerator('Contacts');

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

            \App\Log::trace('Entering helpDeskChangeNotifyContacts');

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

            \App\Log::trace('helpDeskChangeNotifyContacts');

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

                $ownerType = \App\Fields\Owner::getType($smownerId);

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

            \App\Log::trace('helpDeskNewCommentAccount');

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

            \App\Log::trace('Entering helpDeskNewCommentOwner');

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

                $mail = (new \App\Db\Query())->select(['vtiger_account.email1'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_crmentity.crmid = vtiger_account.accountid')->innerJoin('vtiger_troubletickets', 'vtiger_troubletickets.parent_id = vtiger_account.accountid')->where(['vtiger_crmentity.deleted' => 0, 'vtiger_troubletickets.ticketid' => $relatedToId, 'vtiger_account.emailoptout' => 1])->scalar();

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

            $queryGenerator->addNativeCondition(['and', ['vtiger_crmentityrel.crmid' => $id], ['vtiger_crmentityrel.module' => 'HelpDesk']]);

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

            \App\Log::trace('Entering helpDeskNewCommentAccount');

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

                    $user = App\User::getUserModel($smownerId);

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

                        $user = App\User::getUserModel($userId);

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

            return $queryGenerator->createQuery()->column();

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

            $result = (new \App\Db\Query())->select(['smownerid'])->from('vtiger_crmentity')->where(['deleted' => 0, 'crmid' => $relatedToId])->scalar();

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

            \App\Log::trace('helpDeskClosedNotifyContacts');

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

            \App\Log::trace('helpDeskNewCommentContacts');

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        public static function helpDeskClosedNotifyContacts(Vtiger_Record_Model $recordModel)
        {
            \App\Log::trace('Entering helpDeskClosedNotifyContacts');
            $recordId = $recordModel->getId();
            $mails = static::getContactsMailsFromTicket($recordId);
    Severity: Major
    Found in modules/HelpDesk/workflows/HelpDeskWorkflow.php and 1 other location - About 1 hr to fix
    modules/HelpDesk/workflows/HelpDeskWorkflow.php on lines 37..51

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 102.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

        public static function helpDeskChangeNotifyContacts(Vtiger_Record_Model $recordModel)
        {
            \App\Log::trace('Entering helpDeskChangeNotifyContacts');
            $recordId = $recordModel->getId();
            $mails = static::getContactsMailsFromTicket($recordId);
    Severity: Major
    Found in modules/HelpDesk/workflows/HelpDeskWorkflow.php and 1 other location - About 1 hr to fix
    modules/HelpDesk/workflows/HelpDeskWorkflow.php on lines 58..72

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 102.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    class HelpDeskWorkflow

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

        private static function getContactsMailsFromTicket(int $id)

    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 to indent lines; tabs are not allowed
    Open

            $queryGenerator->permissions = false;

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

            if (\count($mails) > 0) {

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

                    'recordId' => $recordId,

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

            if (!empty($relatedToId) && 'HelpDesk' === $moduleName) {

    Line exceeds 120 characters; contains 420 characters
    Open

                $mail = (new \App\Db\Query())->select(['vtiger_account.email1'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_crmentity.crmid = vtiger_account.accountid')->innerJoin('vtiger_troubletickets', 'vtiger_troubletickets.parent_id = vtiger_account.accountid')->where(['vtiger_crmentity.deleted' => 0, 'vtiger_troubletickets.ticketid' => $relatedToId, 'vtiger_account.emailoptout' => 1])->scalar();

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

                \App\Mailer::sendFromTemplate([

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

            \App\Log::trace('helpDeskNewCommentAccount');

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

        public static function helpDeskNewCommentOwner(Vtiger_Record_Model $recordModel)

    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

            $queryGenerator->addNativeCondition(['and', ['vtiger_crmentityrel.crmid' => $id], ['vtiger_crmentityrel.module' => 'HelpDesk']]);

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

        public static function helpDeskClosedNotifyContacts(Vtiger_Record_Model $recordModel)

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

        /**

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

                    'recordId' => $recordModel->getId(),

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

        }

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

                            $mails[] = $user->getDetail('email1');

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

                if ($mails) {

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

                        'moduleName' => 'ModComments',

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

                        'to' => $mails,

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

            if (App\Config::module('HelpDesk', 'CONTACTS_CHECK_EMAIL_OPTOUT')) {

    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\Mailer::sendFromTemplate([

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

            $moduleName = \App\Record::getType($relatedToId);

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

                } else {

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

                    'to' => $mails,

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

            \App\Log::trace('Entering helpDeskClosedNotifyContacts');

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

            if (\count($mails) > 0) {

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

                ]);

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

         * Function to send mail to contacts. Function invoke by workflow.

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

         *

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

         * @param Vtiger_Record_Model $recordModel

    Line exceeds 120 characters; contains 149 characters
    Open

            $result = (new \App\Db\Query())->select(['smownerid'])->from('vtiger_crmentity')->where(['deleted' => 0, 'crmid' => $relatedToId])->scalar();

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

                    }

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

                        'template' => 'NewCommentAddedToTicketOwner',

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

         * Function to get addresses email to contacts.

    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

         * Function to send mail to contacts. Function invoke by workflow.

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

         * @param Vtiger_Record_Model $recordModel

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

                    'to' => $mails,

    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

                    'template' => 'NewCommentAddedToTicketContact',

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

                $ownerType = \App\Fields\Owner::getType($smownerId);

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

                    $user = App\User::getUserModel($smownerId);

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

                    $groupUsers = \App\PrivilegeUtil::getUsersByGroup($smownerId);

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

                        $user = App\User::getUserModel($userId);

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

                    ]);

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

        {

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

            $queryGenerator->addJoin(['INNER JOIN', 'vtiger_crmentityrel', $queryGenerator->getColumnName('id') . '=vtiger_crmentityrel.relcrmid']);

    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

                \App\Mailer::sendFromTemplate([

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

            }

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

         * Function to send mail to accounts. Function invoke by workflow.

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

                $mail = (new \App\Db\Query())->select(['vtiger_account.email1'])->from('vtiger_account')->innerJoin('vtiger_crmentity', 'vtiger_crmentity.crmid = vtiger_account.accountid')->innerJoin('vtiger_troubletickets', 'vtiger_troubletickets.parent_id = vtiger_account.accountid')->where(['vtiger_crmentity.deleted' => 0, 'vtiger_troubletickets.ticketid' => $relatedToId, 'vtiger_account.emailoptout' => 1])->scalar();

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

        {

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

                    'moduleName' => 'ModComments',

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

            }

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

         *

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

            if ($result) {

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

                        if (1 === (int) $user->getDetail('emailoptout')) {

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

        /**

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

            $mails = static::getContactsMailsFromTicket($recordId);

    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

            \App\Log::trace('Entering helpDeskChangeNotifyContacts');

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

            $recordId = $recordModel->getId();

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

                    \App\Mailer::sendFromTemplate([

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

            }

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

        public static function helpDeskNewCommentAccount(Vtiger_Record_Model $recordModel)

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

        /**

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

            $relatedToId = $recordModel->get('related_to');

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

         *

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

                    'template' => 'NotifyContactOnTicketChange',

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

                    'moduleName' => 'HelpDesk',

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

        }

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

            $relatedToId = $recordModel->get('related_to');

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

            }

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

                    'to' => $mail,

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

         * @param Vtiger_Record_Model $recordModel

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

        public static function helpDeskNewCommentContacts(Vtiger_Record_Model $recordModel)

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

            if (($relId = $recordModel->get('related_to')) && 'HelpDesk' === \App\Record::getType($relId) && ($mails = static::getContactsMailsFromTicket($relId))) {

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

                    'recordId' => $recordModel->getId(),

    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

            $queryGenerator->setFields(['email']);

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

            $queryGenerator->addCondition('email', '', 'ny');

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

        }

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

         * Function to send mail to contacts. Function invoke by workflow.

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

         */

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

            $mails = static::getContactsMailsFromTicket($recordId);

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

         * @param Vtiger_Record_Model $recordModel

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

            $mail = false;

    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\Mailer::sendFromTemplate([

    Line exceeds 120 characters; contains 144 characters
    Open

            $queryGenerator->addJoin(['INNER JOIN', 'vtiger_crmentityrel', $queryGenerator->getColumnName('id') . '=vtiger_crmentityrel.relcrmid']);

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

                $queryGenerator->addCondition('emailoptout', 1, 'e');

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

        {

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

                    'moduleName' => 'HelpDesk',

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

        /**

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

                ]);

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

                    if (1 === (int) $user->getDetail('emailoptout')) {

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

                        $mails[] = $user->getDetail('email1');

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

                }

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

        }

    Line exceeds 120 characters; contains 137 characters
    Open

            $queryGenerator->addNativeCondition(['and', ['vtiger_crmentityrel.crmid' => $id], ['vtiger_crmentityrel.module' => 'HelpDesk']]);

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

        public static function helpDeskChangeNotifyContacts(Vtiger_Record_Model $recordModel)

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

            \App\Log::trace('helpDeskChangeNotifyContacts');

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

            \App\Log::trace('helpDeskClosedNotifyContacts');

    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('Entering helpDeskNewCommentAccount');

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

                    'template' => 'NewCommentAddedToTicketAccount',

    Line exceeds 120 characters; contains 161 characters
    Open

            if (($relId = $recordModel->get('related_to')) && 'HelpDesk' === \App\Record::getType($relId) && ($mails = static::getContactsMailsFromTicket($relId))) {

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

                    'to' => $mails,

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

            \App\Log::trace('helpDeskNewCommentOwner');

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

        private static function getContactsMailsFromTicket(int $id)

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

            $queryGenerator = new \App\QueryGenerator('Contacts');

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

         * @param Vtiger_Record_Model $recordModel

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

            if ($mail) {

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

            \App\Log::trace('helpDeskNewCommentContacts');

    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

                    'recordId' => $recordId,

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

            $result = (new \App\Db\Query())->select(['smownerid'])->from('vtiger_crmentity')->where(['deleted' => 0, 'crmid' => $relatedToId])->scalar();

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

                $mails = [];

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

                        }

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

         * @param int $id

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

         * @return array

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

            $recordId = $recordModel->getId();

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

                    'template' => 'NotifyContactOnTicketClosed',

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

                    'moduleName' => 'ModComments',

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

            \App\Log::trace('Entering helpDeskNewCommentContacts');

    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('Entering helpDeskNewCommentOwner');

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

                $smownerId = $result;

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

                }

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

            return $queryGenerator->createQuery()->column();

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

            }

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

         * Function to send mail to users. Function invoke by workflow.

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

                if ('Users' === $ownerType) {

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

                    foreach ($groupUsers as $userId) {

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

                        'recordId' => $recordModel->getId(),

    There are no issues that match your filters.

    Category
    Status