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