| Conditions | 4 |
| Paths | 8 |
| Total Lines | 77 |
| Code Lines | 68 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 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 |
||
| 138 | public function addTransactionLogEntry($aRequest, ?Order $oOrder = null, $blHasBeenHandled = true) |
||
| 139 | { |
||
| 140 | $this->setRequest($aRequest); |
||
| 141 | |||
| 142 | $aRequestForLog = $this->getRequest(); |
||
| 143 | if (!empty($aRequestForLog['customer_iban'])) { |
||
| 144 | $aRequestForLog['customer_iban'] = $this->toolkitHelper->maskIban($aRequestForLog['customer_iban']); |
||
| 145 | } |
||
| 146 | |||
| 147 | $sRawStatus = serialize($aRequestForLog); |
||
| 148 | if (!$this->toolkitHelper->isUTF8($sRawStatus)) { |
||
| 149 | $sRawStatus = mb_convert_encoding($sRawStatus, 'UTF-8'); // needed for serializing the array |
||
| 150 | } |
||
| 151 | $sOrderId = $oOrder !== null ? $oOrder->getIncrementId() : ''; |
||
| 152 | $this->getConnection()->insert( |
||
| 153 | $this->getMainTable(), |
||
| 154 | [ |
||
| 155 | 'order_id' => $sOrderId, |
||
| 156 | 'store_id' => $this->storeManager->getStore()->getId(), |
||
| 157 | 'reference' => $this->getParam('reference'), |
||
| 158 | 'txid' => $this->getParam('txid'), |
||
| 159 | 'txaction' => $this->getParam('txaction'), |
||
| 160 | 'sequencenumber' => $this->getParam('sequencenumber'), |
||
| 161 | 'clearingtype' => $this->getParam('clearingtype'), |
||
| 162 | 'txtime' => date('Y-m-d H:i:s', $this->getParam('txtime')), |
||
| 163 | 'price' => $this->getParam('price'), |
||
| 164 | 'balance' => $this->getParam('balance'), |
||
| 165 | 'receivable' => $this->getParam('receivable'), |
||
| 166 | 'currency' => $this->getParam('currency'), |
||
| 167 | 'aid' => $this->getParam('aid'), |
||
| 168 | 'portalid' => $this->getParam('portalid'), |
||
| 169 | 'key' => $this->getParam('key'), |
||
| 170 | 'mode' => $this->getParam('mode'), |
||
| 171 | 'userid' => $this->getParam('userid'), |
||
| 172 | 'customerid' => $this->getParam('customerid'), |
||
| 173 | 'company' => $this->getParam('company'), |
||
| 174 | 'firstname' => $this->getParam('firstname'), |
||
| 175 | 'lastname' => $this->getParam('lastname'), |
||
| 176 | 'street' => $this->getParam('street'), |
||
| 177 | 'zip' => $this->getParam('zip'), |
||
| 178 | 'city' => $this->getParam('city'), |
||
| 179 | 'email' => $this->getParam('email'), |
||
| 180 | 'country' => $this->getParam('country'), |
||
| 181 | 'shipping_company' => $this->getParam('shipping_company'), |
||
| 182 | 'shipping_firstname' => $this->getParam('shipping_firstname'), |
||
| 183 | 'shipping_lastname' => $this->getParam('shipping_lastname'), |
||
| 184 | 'shipping_street' => $this->getParam('shipping_street'), |
||
| 185 | 'shipping_zip' => $this->getParam('shipping_zip'), |
||
| 186 | 'shipping_city' => $this->getParam('shipping_city'), |
||
| 187 | 'shipping_country' => $this->getParam('shipping_country'), |
||
| 188 | 'param' => $this->getParam('param'), |
||
| 189 | 'accessname' => $this->getParam('accessname'), |
||
| 190 | 'accesscode' => $this->getParam('accesscode'), |
||
| 191 | 'bankcountry' => $this->getParam('bankcountry'), |
||
| 192 | 'bankaccount' => $this->getParam('bankaccount'), |
||
| 193 | 'bankcode' => $this->getParam('bankcode'), |
||
| 194 | 'bankaccountholder' => $this->getParam('bankaccountholder'), |
||
| 195 | 'cardexpiredate' => $this->getParam('cardexpiredate'), |
||
| 196 | 'cardtype' => $this->getParam('cardtype'), |
||
| 197 | 'cardpan' => $this->getParam('cardpan'), |
||
| 198 | 'clearing_bankaccountholder' => $this->getParam('clearing_bankaccountholder'), |
||
| 199 | 'clearing_bankaccount' => $this->getParam('clearing_bankaccount'), |
||
| 200 | 'clearing_bankcode' => $this->getParam('clearing_bankcode'), |
||
| 201 | 'clearing_bankname' => $this->getParam('clearing_bankname'), |
||
| 202 | 'clearing_bankbic' => $this->getParam('clearing_bankbic'), |
||
| 203 | 'clearing_bankiban' => $this->getParam('clearing_bankiban'), |
||
| 204 | 'clearing_bankcountry' => $this->getParam('clearing_bankcountry'), |
||
| 205 | 'clearing_bankcity' => $this->getParam('clearing_bankcity'), |
||
| 206 | 'clearing_legalnote' => $this->getParam('clearing_legalnote'), |
||
| 207 | 'clearing_duedate' => $this->getParam('clearing_duedate'), |
||
| 208 | 'clearing_reference' => $this->getParam('clearing_reference'), |
||
| 209 | 'clearing_instructionnote' => $this->getParam('clearing_instructionnote'), |
||
| 210 | 'raw_status' => $sRawStatus, |
||
| 211 | 'has_been_handled' => $blHasBeenHandled |
||
| 212 | ] |
||
| 213 | ); |
||
| 214 | return $this; |
||
| 215 | } |
||
| 234 |
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