| Conditions | 12 |
| Paths | 29 |
| Total Lines | 36 |
| Code Lines | 23 |
| 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 |
||
| 104 | public function sendRequest(AddressInterface $oAddress, $sGender = null, $sBirthday = null) |
||
| 105 | { |
||
| 106 | if (!$this->isCheckEnabled() || $oAddress->getCountryId() != 'DE') { |
||
| 107 | return true; |
||
| 108 | } |
||
| 109 | |||
| 110 | $sType = $this->shopHelper->getConfigParam('type', 'creditrating', 'payone_protect'); |
||
| 111 | |||
| 112 | $this->addParameter('request', 'consumerscore'); |
||
| 113 | $this->addParameter('mode', $this->shopHelper->getConfigParam('mode', 'creditrating', 'payone_protect')); //Operationmode live or test |
||
| 114 | $this->addParameter('aid', $this->shopHelper->getConfigParam('aid')); //ID of PayOne Sub-Account |
||
| 115 | $this->addParameter('addresschecktype', $this->getCombinedAdressCheckType()); |
||
| 116 | $this->addParameter('consumerscoretype', $sType); |
||
| 117 | $this->addParameter('language', $this->shopHelper->getLocale()); |
||
| 118 | |||
| 119 | if ($sType == CreditratingCheckType::BONIVERSUM_VERITA && $sGender !== null) { |
||
| 120 | $this->addParameter('gender', $sGender); |
||
| 121 | } |
||
| 122 | if ($sType == CreditratingCheckType::BONIVERSUM_VERITA && $sBirthday !== null) { |
||
| 123 | $this->addParameter('birthday', $sBirthday); |
||
| 124 | } |
||
| 125 | |||
| 126 | $this->addAddress($oAddress); |
||
| 127 | if ($this->addressesChecked->wasAddressCheckedBefore($oAddress, $sType,true) === false) { |
||
| 128 | $aResponse = $this->send(); |
||
| 129 | if (isset($aResponse['score']) && $aResponse['score'] === 'U') { |
||
| 130 | $unknownDefault = $this->shopHelper->getConfigParam('unknown_value', 'creditrating', 'payone_protect'); |
||
| 131 | $aResponse['score'] = empty($unknownDefault) ? 'G' : $unknownDefault; |
||
| 132 | } |
||
| 133 | if ($aResponse['status'] == 'VALID') { |
||
| 134 | $this->addressesChecked->addCheckedAddress($oAddress, $aResponse, $sType,true); |
||
| 135 | } |
||
| 136 | |||
| 137 | return $aResponse; |
||
| 138 | } |
||
| 139 | return true; |
||
| 140 | } |
||
| 142 |
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