Method process
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(): void
{
if ($this->checkExceptions('CreatedHelpDesk')) {
return;
}
Function process
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function process(): void
{
if ($this->checkExceptions('CreatedHelpDesk')) {
return;
}
- Read upRead up
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;
}
- Read upRead up
- Exclude checks
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;
}
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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]);
- Read upRead up
- Exclude checks
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;
}
- Read upRead up
- Exclude checks
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')) {
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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'))));
- Read upRead up
- Exclude checks
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'))));
- Read upRead up
- Exclude checks
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')) {
- Read upRead up
- Exclude checks
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'))));
- Read upRead up
- Exclude checks
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));
- Read upRead up
- Exclude checks
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'))));
- Read upRead up
- Exclude checks
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'))));
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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;
}
- Read upRead up
- Exclude checks
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'))));
- Read upRead up
- Exclude checks
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()));
- Read upRead up
- Exclude checks
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'])) {
- Read upRead up
- Exclude checks
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'))));
- Read upRead up
- Exclude checks
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']);
- Read upRead up
- Exclude checks
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')) {
- Read upRead up
- Exclude checks
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();
- Exclude checks
Call to method setFields
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator->setFields(['id', 'contract_priority']);
- Exclude checks
Reference to instance property permissions
from undeclared class \App\QueryGenerator
Open
$queryGenerator->permissions = false;
- Exclude checks
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
- Exclude checks
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]);
- Exclude checks
Reference to static property helpdeskCreateDefaultStatus
from undeclared class \Config\Modules\OSSMailScanner
Open
$recordModel->set('ticketstatus', \Config\Modules\OSSMailScanner::$helpdeskCreateDefaultStatus);
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$query = (new \App\Db\Query())->select(['documentsid'])->from('vtiger_ossmailview_files')->where(['ossmailviewid' => $mailId]);
- Exclude checks
Call to method __construct
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator = new \App\QueryGenerator('ServiceContracts');
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$dbCommand = \App\Db::getInstance()->createCommand();
- Exclude checks
Call to method addCondition
from undeclared class \App\QueryGenerator
(Did you mean class \Tests\App\QueryGenerator) Open
$queryGenerator->addCondition('contract_status', 'In Progress', 'e');
- Exclude checks
Avoid variables with short names like $id. Configured minimum length is 3. Open
$id = $recordModel->getId();
- Read upRead up
- Exclude checks
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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = $query->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$serviceContracts = $dataReader->read();
- Exclude checks
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')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$contactId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Contacts'))));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$id = $recordModel->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator->addNativeCondition(['vtiger_servicecontracts.sc_related_to' => $parentId]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$parentId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$parentId && $contactId) {
- Exclude checks
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));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 161 characters Open
if (($prefix = RecordFinder::getRecordNumberFromString($scanner->get('subject'), 'HelpDesk')) && \App\Record::getIdByRecordNumber($prefix, 'HelpDesk')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fromEmail = [$scanner->get('from_email')];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parentId = \App\Record::getParentRecord($contactId, 'Contacts');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int|bool $parentId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (1 === $dataReader->count()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('servicecontractsid', $serviceContracts['id']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
$contactId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Contacts'))));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->ext['relations'][] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$scanner->processData['CreatedHelpDesk'] = $id;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand = \App\Db::getInstance()->createCommand();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->insert('vtiger_senotesrel', ['crmid' => $id, 'notesid' => $documentId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private function loadServiceContracts(\Vtiger_Record_Model $recordModel, $parentId)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parentId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Vendors'))));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'relatedRecords' => [$contactId],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('createdtime', $scanner->get('date'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('ticketstatus', \Config\Modules\OSSMailScanner::$helpdeskCreateDefaultStatus);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'relatedModule' => 'OSSMailView',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator->setFields(['id', 'contract_priority']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('ticketpriorities', $serviceContracts['contract_priority']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$parentId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Accounts'))));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->loadServiceContracts($recordModel, $parentId);
- Exclude checks
Line exceeds 120 characters; contains 148 characters Open
$recordModel->set('description', \App\TextUtils::htmlTruncate($scanner->get('body'), $recordModel->getField('description')->getMaxValue()));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'relatedModule' => 'Contacts',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->ext['relations'][] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'params' => $scanner->get('date'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($mailId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($dataReader,$query, $dbCommand, $recordModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('parent_id', $parentId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator = new \App\QueryGenerator('ServiceContracts');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\Fields\Picklist::isExists('ticketpriorities', $serviceContracts['contract_priority'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static $priority = 5;
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
$parentId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Accounts'))));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('assigned_user_id', $scanner->getUserId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->set('created_user_id', $scanner->getUserId());
- Exclude checks
Line exceeds 120 characters; contains 173 characters Open
$recordModel->setFromUserValue('ticket_title', \App\TextUtils::textTruncate($scanner->get('subject'), $recordModel->getField('ticket_title')->getMaxValue(), false));
- Exclude checks
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()));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'reverse' => true,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($dataReader, $queryGenerator);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = \Vtiger_Record_Model::getCleanInstance('HelpDesk');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($mailId = $scanner->getMailCrmId()) {
- Exclude checks
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]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param Vtiger_Record_Model $recordModel
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator->permissions = false;
- Exclude checks
Line exceeds 120 characters; contains 139 characters Open
$query = (new \App\Db\Query())->select(['documentsid'])->from('vtiger_ossmailview_files')->where(['ossmailviewid' => $mailId]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = $queryGenerator->createQuery()->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($contactId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$parentId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Find service contracts and init data.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function process(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->checkExceptions('CreatedHelpDesk')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$scanner = $this->scannerEngine;
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
$parentId = current(\App\Utils::flatten(RecordFinder::findByEmail($fromEmail, $scanner->getEmailsFields('Vendors'))));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'relatedRecords' => [$mailId],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($documentId = $dataReader->readColumn(0)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$queryGenerator->addCondition('contract_status', 'In Progress', 'e');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
No space found after comma in function call Open
unset($dataReader,$query, $dbCommand, $recordModel);
- Exclude checks