YetiForceCompany/YetiForceCRM

View on GitHub
app/Mail/ScannerAction/CreatedHelpDesk.php

Summary

Maintainability
A
3 hrs
Test Coverage
F
0%

Method process has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function process(): void
    {
        if ($this->checkExceptions('CreatedHelpDesk')) {
            return;
        }
Severity: Major
Found in app/Mail/ScannerAction/CreatedHelpDesk.php - About 2 hrs to fix

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

        public function process(): void
        {
            if ($this->checkExceptions('CreatedHelpDesk')) {
                return;
            }
    Severity: Minor
    Found in app/Mail/ScannerAction/CreatedHelpDesk.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

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

        public function process(): void
        {
            if ($this->checkExceptions('CreatedHelpDesk')) {
                return;
            }

    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 11. The configured cyclomatic complexity threshold is 10.
    Open

        public function process(): void
        {
            if ($this->checkExceptions('CreatedHelpDesk')) {
                return;
            }

    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

    Missing class import via use statement (line '94', column '25').
    Open

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

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

                $query = (new \App\Db\Query())->select(['documentsid'])->from('vtiger_ossmailview_files')->where(['ossmailviewid' => $mailId]);

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

        public function process(): void
        {
            if ($this->checkExceptions('CreatedHelpDesk')) {
                return;
            }

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

            if (($prefix = RecordFinder::getRecordNumberFromString($scanner->get('subject'), 'HelpDesk')) && \App\Record::getIdByRecordNumber($prefix, 'HelpDesk')) {

    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_Record_Model' in method 'process'.
    Open

            $recordModel = \Vtiger_Record_Model::getCleanInstance('HelpDesk');

    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

            $contactId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Contacts'))));

    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

                $parentId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Vendors'))));

    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\Mail\RecordFinder' in method 'process'.
    Open

            if (($prefix = RecordFinder::getRecordNumberFromString($scanner->get('subject'), 'HelpDesk')) && \App\Record::getIdByRecordNumber($prefix, 'HelpDesk')) {

    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\Mail\RecordFinder' in method 'process'.
    Open

            $parentId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Accounts'))));

    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\TextUtils' in method 'process'.
    Open

            $recordModel->setFromUserValue('ticket_title', \App\TextUtils::textTruncate($scanner->get('subject'), $recordModel->getField('ticket_title')->getMaxValue(), false));

    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

            $parentId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Accounts'))));

    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\Mail\RecordFinder' in method 'process'.
    Open

                $parentId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Vendors'))));

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

                $parentId = \App\Record::getParentRecord($contactId, 'Contacts');

    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 '31', column '8').
    Open

        public function process(): void
        {
            if ($this->checkExceptions('CreatedHelpDesk')) {
                return;
            }

    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\Mail\RecordFinder' in method 'process'.
    Open

            $contactId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Contacts'))));

    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\TextUtils' in method 'process'.
    Open

            $recordModel->set('description', \App\TextUtils::htmlTruncate($scanner->get('body'), $recordModel->getField('description')->getMaxValue()));

    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\Picklist' in method 'loadServiceContracts'.
    Open

                if (\App\Fields\Picklist::isExists('ticketpriorities', $serviceContracts['contract_priority'])) {

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

            $contactId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Contacts'))));

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

            $queryGenerator->setFields(['id', 'contract_priority']);

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

            if (($prefix = RecordFinder::getRecordNumberFromString($scanner->get('subject'), 'HelpDesk')) && \App\Record::getIdByRecordNumber($prefix, '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.

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

            $dataReader = $queryGenerator->createQuery()->createCommand()->query();
    Severity: Critical
    Found in app/Mail/ScannerAction/CreatedHelpDesk.php by phan

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

            $queryGenerator->setFields(['id', 'contract_priority']);
    Severity: Critical
    Found in app/Mail/ScannerAction/CreatedHelpDesk.php by phan

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

            $queryGenerator->permissions = false;

    Doc-block of $recordModel in loadServiceContracts contains phpdoc param type \App\Mail\ScannerAction\Vtiger_Record_Model which is incompatible with the param type \Vtiger_Record_Model declared in the signature
    Open

         * @param Vtiger_Record_Model $recordModel

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

            $queryGenerator->addNativeCondition(['vtiger_servicecontracts.sc_related_to' => $parentId]);
    Severity: Critical
    Found in app/Mail/ScannerAction/CreatedHelpDesk.php by phan

    Reference to static property helpdeskCreateDefaultStatus from undeclared class \Config\Modules\OSSMailScanner
    Open

            $recordModel->set('ticketstatus', \Config\Modules\OSSMailScanner::$helpdeskCreateDefaultStatus);
    Severity: Critical
    Found in app/Mail/ScannerAction/CreatedHelpDesk.php by phan

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

                $query = (new \App\Db\Query())->select(['documentsid'])->from('vtiger_ossmailview_files')->where(['ossmailviewid' => $mailId]);
    Severity: Critical
    Found in app/Mail/ScannerAction/CreatedHelpDesk.php by phan

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

            $queryGenerator = new \App\QueryGenerator('ServiceContracts');
    Severity: Critical
    Found in app/Mail/ScannerAction/CreatedHelpDesk.php by phan

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

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

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

            $queryGenerator->addCondition('contract_status', 'In Progress', 'e');
    Severity: Critical
    Found in app/Mail/ScannerAction/CreatedHelpDesk.php by phan

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

            $id = $recordModel->getId();

    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

        {

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

            }

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

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

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

         * @return void

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

                $serviceContracts = $dataReader->read();

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

            if (($prefix = RecordFinder::getRecordNumberFromString($scanner->get('subject'), 'HelpDesk')) && \App\Record::getIdByRecordNumber($prefix, 'HelpDesk')) {

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

            $contactId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Contacts'))));

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

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

            }

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

            $queryGenerator->addNativeCondition(['vtiger_servicecontracts.sc_related_to' => $parentId]);

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

            if (!$parentId) {

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

            if (!$parentId && $contactId) {

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

            $recordModel->setFromUserValue('ticket_title', \App\TextUtils::textTruncate($scanner->get('subject'), $recordModel->getField('ticket_title')->getMaxValue(), false));

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

                }

    Line exceeds 120 characters; contains 161 characters
    Open

            if (($prefix = RecordFinder::getRecordNumberFromString($scanner->get('subject'), 'HelpDesk')) && \App\Record::getIdByRecordNumber($prefix, 'HelpDesk')) {

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

            $fromEmail = [$scanner->get('from_email')];

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

                $parentId = \App\Record::getParentRecord($contactId, '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

         * @param int|bool            $parentId

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

            if (1 === $dataReader->count()) {

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

                $recordModel->set('servicecontractsid', $serviceContracts['id']);

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

            }

    Line exceeds 120 characters; contains 128 characters
    Open

            $contactId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Contacts'))));

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

                $recordModel->ext['relations'][] = [

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

            $recordModel->save();

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

            $scanner->processData['CreatedHelpDesk'] = $id;

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

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

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

                    $dbCommand->insert('vtiger_senotesrel', ['crmid' => $id, 'notesid' => $documentId])->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

        private function loadServiceContracts(\Vtiger_Record_Model $recordModel, $parentId)

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

            $dataReader->close();

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

        /** {@inheritdoc} */

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

                return;

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

                $parentId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Vendors'))));

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

                    'relatedRecords' => [$contactId],

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

            }

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

            $recordModel->set('createdtime', $scanner->get('date'));

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

            $recordModel->set('ticketstatus', \Config\Modules\OSSMailScanner::$helpdeskCreateDefaultStatus);

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

                    'relatedModule' => 'OSSMailView',

    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(['id', 'contract_priority']);

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

                    $recordModel->set('ticketpriorities', $serviceContracts['contract_priority']);

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

            $parentId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Accounts'))));

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

            }

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

            $this->loadServiceContracts($recordModel, $parentId);

    Line exceeds 120 characters; contains 148 characters
    Open

            $recordModel->set('description', \App\TextUtils::htmlTruncate($scanner->get('body'), $recordModel->getField('description')->getMaxValue()));

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

                    'relatedModule' => 'Contacts',

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

                $recordModel->ext['relations'][] = [

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

                    'params' => $scanner->get('date'),

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

            if ($mailId) {

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

                unset($dataReader,$query, $dbCommand, $recordModel);

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

            $recordModel->set('parent_id', $parentId);

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

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

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

                if (\App\Fields\Picklist::isExists('ticketpriorities', $serviceContracts['contract_priority'])) {

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

        public static $priority = 5;

    Line exceeds 120 characters; contains 127 characters
    Open

            $parentId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Accounts'))));

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

            $recordModel->set('assigned_user_id', $scanner->getUserId());

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

            $recordModel->set('created_user_id', $scanner->getUserId());

    Line exceeds 120 characters; contains 173 characters
    Open

            $recordModel->setFromUserValue('ticket_title', \App\TextUtils::textTruncate($scanner->get('subject'), $recordModel->getField('ticket_title')->getMaxValue(), false));

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

            $recordModel->set('description', \App\TextUtils::htmlTruncate($scanner->get('body'), $recordModel->getField('description')->getMaxValue()));

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

                ];

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

                    'reverse' => true,

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

            unset($dataReader, $queryGenerator);

    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

            $recordModel = \Vtiger_Record_Model::getCleanInstance('HelpDesk');

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

            if ($mailId = $scanner->getMailCrmId()) {

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

                $query = (new \App\Db\Query())->select(['documentsid'])->from('vtiger_ossmailview_files')->where(['ossmailviewid' => $mailId]);

    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

                return;

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

            $queryGenerator->permissions = false;

    Line exceeds 120 characters; contains 139 characters
    Open

                $query = (new \App\Db\Query())->select(['documentsid'])->from('vtiger_ossmailview_files')->where(['ossmailviewid' => $mailId]);

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

                $dataReader->close();

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

            }

    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

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

    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

            if ($contactId) {

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

            if (!$parentId) {

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

            }

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

         * Find service contracts and init data.

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

        public function process(): void

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

            if ($this->checkExceptions('CreatedHelpDesk')) {

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

                return;

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

            $scanner = $this->scannerEngine;

    Line exceeds 120 characters; contains 130 characters
    Open

                $parentId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Vendors'))));

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

                    'relatedRecords' => [$mailId],

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

                while ($documentId = $dataReader->readColumn(0)) {

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

            $queryGenerator->addCondition('contract_status', 'In Progress', 'e');

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

        }

    No space found after comma in function call
    Open

                unset($dataReader,$query, $dbCommand, $recordModel);

    There are no issues that match your filters.

    Category
    Status