| Conditions | 18 |
| Paths | 18 |
| Total Lines | 52 |
| Code Lines | 44 |
| 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 |
||
| 162 | protected function parseTransactionType() |
||
| 163 | { |
||
| 164 | $code = $this->parseTransactionCode(); |
||
| 165 | switch ($code) { |
||
| 166 | case 541: |
||
| 167 | case 544: |
||
| 168 | case 102: // "Betaalopdracht IDEAL" |
||
| 169 | case 547: |
||
| 170 | $result = TransactionType::get(TransactionType::SEPA_TRANSFER); |
||
|
|
|||
| 171 | break; |
||
| 172 | |||
| 173 | case 504: |
||
| 174 | case 691: |
||
| 175 | $result = TransactionType::get(TransactionType::SAVINGS_TRANSFER); |
||
| 176 | break; |
||
| 177 | case 64: |
||
| 178 | $result = TransactionType::get(TransactionType::SEPA_DIRECTDEBIT); |
||
| 179 | break; |
||
| 180 | case 93: |
||
| 181 | $result = TransactionType::get(TransactionType::BANK_COSTS); |
||
| 182 | break; |
||
| 183 | case 13: |
||
| 184 | case 12: |
||
| 185 | case 30: |
||
| 186 | $result = TransactionType::get(TransactionType::PAYMENT_TERMINAL); |
||
| 187 | break; |
||
| 188 | case 29: |
||
| 189 | case 31: |
||
| 190 | $result = TransactionType::get(TransactionType::ATM_WITHDRAWAL); |
||
| 191 | break; |
||
| 192 | case "MSC": |
||
| 193 | $result = TransactionType::get(TransactionType::BANK_INTEREST); |
||
| 194 | break; |
||
| 195 | case 404: // "Buitenland transactie credit" |
||
| 196 | if (stripos($this->getCurrentTransactionData(), 'eurobetaling') !== false) { |
||
| 197 | $result = TransactionType::get(TransactionType::SEPA_TRANSFER); |
||
| 198 | } else { |
||
| 199 | $result = TransactionType::get(TransactionType::TRANSFER); |
||
| 200 | } |
||
| 201 | |||
| 202 | break; |
||
| 203 | case 79: // "Acceptgiro Mobiel Bankieren" |
||
| 204 | $result = TransactionType::get(TransactionType::UNKNOWN); |
||
| 205 | break; |
||
| 206 | |||
| 207 | default: |
||
| 208 | var_dump($code); |
||
| 209 | var_dump($this->getCurrentTransactionData()); die(); |
||
| 210 | throw new \RuntimeException("Don't know code $code for RABOBANK"); |
||
| 211 | } |
||
| 212 | |||
| 213 | return $result; |
||
| 214 | } |
||
| 217 |
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