| Conditions | 11 |
| Paths | 1024 |
| Total Lines | 91 |
| Code Lines | 60 |
| 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 |
||
| 25 | public function index() |
||
| 26 | { |
||
| 27 | $this->load->language('checkout/checkout'); |
||
| 28 | |||
| 29 | $data['text_select'] = $this->language->get('text_select'); |
||
| 30 | $data['text_none'] = $this->language->get('text_none'); |
||
| 31 | $data['text_loading'] = $this->language->get('text_loading'); |
||
| 32 | |||
| 33 | $data['entry_firstname'] = $this->language->get('entry_firstname'); |
||
| 34 | $data['entry_lastname'] = $this->language->get('entry_lastname'); |
||
| 35 | $data['entry_company'] = $this->language->get('entry_company'); |
||
| 36 | $data['entry_address_1'] = $this->language->get('entry_address_1'); |
||
| 37 | $data['entry_address_2'] = $this->language->get('entry_address_2'); |
||
| 38 | $data['entry_postcode'] = $this->language->get('entry_postcode'); |
||
| 39 | $data['entry_city'] = $this->language->get('entry_city'); |
||
| 40 | $data['entry_country'] = $this->language->get('entry_country'); |
||
| 41 | $data['entry_zone'] = $this->language->get('entry_zone'); |
||
| 42 | |||
| 43 | $data['button_continue'] = $this->language->get('button_continue'); |
||
| 44 | $data['button_upload'] = $this->language->get('button_upload'); |
||
| 45 | |||
| 46 | if (isset($this->session->data['shipping_address']['firstname'])) { |
||
| 47 | $data['firstname'] = $this->session->data['shipping_address']['firstname']; |
||
| 48 | } else { |
||
| 49 | $data['firstname'] = ''; |
||
| 50 | } |
||
| 51 | |||
| 52 | if (isset($this->session->data['shipping_address']['lastname'])) { |
||
| 53 | $data['lastname'] = $this->session->data['shipping_address']['lastname']; |
||
| 54 | } else { |
||
| 55 | $data['lastname'] = ''; |
||
| 56 | } |
||
| 57 | |||
| 58 | if (isset($this->session->data['shipping_address']['company'])) { |
||
| 59 | $data['company'] = $this->session->data['shipping_address']['company']; |
||
| 60 | } else { |
||
| 61 | $data['company'] = ''; |
||
| 62 | } |
||
| 63 | |||
| 64 | if (isset($this->session->data['shipping_address']['address_1'])) { |
||
| 65 | $data['address_1'] = $this->session->data['shipping_address']['address_1']; |
||
| 66 | } else { |
||
| 67 | $data['address_1'] = ''; |
||
| 68 | } |
||
| 69 | |||
| 70 | if (isset($this->session->data['shipping_address']['address_2'])) { |
||
| 71 | $data['address_2'] = $this->session->data['shipping_address']['address_2']; |
||
| 72 | } else { |
||
| 73 | $data['address_2'] = ''; |
||
| 74 | } |
||
| 75 | |||
| 76 | if (isset($this->session->data['shipping_address']['postcode'])) { |
||
| 77 | $data['postcode'] = $this->session->data['shipping_address']['postcode']; |
||
| 78 | } else { |
||
| 79 | $data['postcode'] = ''; |
||
| 80 | } |
||
| 81 | |||
| 82 | if (isset($this->session->data['shipping_address']['city'])) { |
||
| 83 | $data['city'] = $this->session->data['shipping_address']['city']; |
||
| 84 | } else { |
||
| 85 | $data['city'] = ''; |
||
| 86 | } |
||
| 87 | |||
| 88 | if (isset($this->session->data['shipping_address']['country_id'])) { |
||
| 89 | $data['country_id'] = $this->session->data['shipping_address']['country_id']; |
||
| 90 | } else { |
||
| 91 | $data['country_id'] = $this->config->get('config_country_id'); |
||
| 92 | } |
||
| 93 | |||
| 94 | if (isset($this->session->data['shipping_address']['zone_id'])) { |
||
| 95 | $data['zone_id'] = $this->session->data['shipping_address']['zone_id']; |
||
| 96 | } else { |
||
| 97 | $data['zone_id'] = ''; |
||
| 98 | } |
||
| 99 | |||
| 100 | $this->load->model('localisation/country'); |
||
| 101 | |||
| 102 | $data['countries'] = $this->model_localisation_country->getCountries(); |
||
| 103 | |||
| 104 | // Custom Fields |
||
| 105 | $this->load->model('account/custom_field'); |
||
| 106 | |||
| 107 | $data['custom_fields'] = $this->model_account_custom_field->getCustomFields($this->session->data['guest']['customer_group_id']); |
||
| 108 | |||
| 109 | if (isset($this->session->data['shipping_address']['custom_field'])) { |
||
| 110 | $data['address_custom_field'] = $this->session->data['shipping_address']['custom_field']; |
||
| 111 | } else { |
||
| 112 | $data['address_custom_field'] = array(); |
||
| 113 | } |
||
| 114 | |||
| 115 | $this->response->setOutput($this->load->view('checkout/guest_shipping', $data)); |
||
| 116 | } |
||
| 239 |
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