| Conditions | 10 |
| Paths | 7 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 26 | public function process(): void |
||
| 27 | { |
||
| 28 | $scanner = $this->message; |
||
| 29 | if ($this->checkExceptions() || \App\Mail\Message\Base::MAIL_TYPE_RECEIVED !== $scanner->getMailType() || !($prefix = RecordFinder::getRecordNumberFromString($this->message->getSubject(), 'HelpDesk')) || !($id = \App\Record::getIdByRecordNumber($prefix, 'HelpDesk'))) { |
||
| 30 | return; |
||
| 31 | } |
||
| 32 | $recordModel = \Vtiger_Record_Model::getInstanceById($id, 'HelpDesk'); |
||
| 33 | if ('Wait For Response' === $recordModel->get('ticketstatus') && !empty(\Config\Modules\OSSMailScanner::$helpdeskBindNextWaitForResponseStatus)) { |
||
|
|
|||
| 34 | $recordModel->set('ticketstatus', \Config\Modules\OSSMailScanner::$helpdeskBindNextWaitForResponseStatus); |
||
| 35 | } elseif (($ticketStatus = array_flip(\Settings_SupportProcesses_Module_Model::getTicketStatusNotModify())) && isset($ticketStatus[$recordModel->get('ticketstatus')])) { |
||
| 36 | $recordModel->set('ticketstatus', \Config\Modules\OSSMailScanner::$helpdeskBindOpenStatus); |
||
| 37 | } |
||
| 38 | |||
| 39 | if ($recordModel->getPreviousValue()) { |
||
| 40 | $recordModel->save(); |
||
| 41 | } |
||
| 42 | |||
| 43 | $this->message->setProcessData($this->getName(), ['crmid' => $recordModel->getId()]); |
||
| 44 | } |
||
| 46 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths