| Conditions | 3 |
| Paths | 4 |
| Total Lines | 72 |
| Code Lines | 25 |
| 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 |
||
| 29 | public function index() |
||
| 30 | { |
||
| 31 | |||
| 32 | // scripts & styles |
||
| 33 | // $this->document->addStyle('https://cdnjs.cloudflare.com/ajax/libs/diff2html/2.9.0/diff2html.min.css'); |
||
| 34 | // $this->document->addScript('https://cdnjs.cloudflare.com/ajax/libs/diff2html/2.9.0/diff2html.min.js'); |
||
| 35 | // $this->document->addScript('https://cdnjs.cloudflare.com/ajax/libs/diff2html/2.9.0/diff2html-ui.min.js'); |
||
| 36 | |||
| 37 | // language |
||
| 38 | // load lang file |
||
| 39 | $this->load->language('tool/updater'); |
||
| 40 | // set standart defines |
||
| 41 | $this->document->setTitle($this->language->get('heading_title')); |
||
| 42 | $data['heading_title'] = $this->language->get('heading_title'); |
||
| 43 | // set user defines |
||
| 44 | $data['updater_update_text'] = $this->language->get('updater_update_text'); |
||
| 45 | |||
| 46 | // alert warning |
||
| 47 | if (isset($this->error['warning'])) { |
||
| 48 | $data['error_warning'] = $this->error['warning']; |
||
| 49 | } else { |
||
| 50 | $data['error_warning'] = ''; |
||
| 51 | } |
||
| 52 | |||
| 53 | // alert success |
||
| 54 | if (isset($this->session->data['success'])) { |
||
| 55 | $data['success'] = $this->language->get('text_success'); |
||
| 56 | |||
| 57 | unset($this->session->data['success']); |
||
| 58 | } else { |
||
| 59 | $data['success'] = ''; |
||
| 60 | } |
||
| 61 | |||
| 62 | // breadcrumbs |
||
| 63 | $data['breadcrumbs'] = array(); |
||
| 64 | |||
| 65 | $data['breadcrumbs'][] = array( |
||
| 66 | 'text' => $this->language->get('text_home'), |
||
| 67 | 'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], true) |
||
| 68 | ); |
||
| 69 | |||
| 70 | $data['breadcrumbs'][] = array( |
||
| 71 | 'text' => $this->language->get('heading_title'), |
||
| 72 | 'href' => $this->url->link('tool/updater', 'token=' . $this->session->data['token'], true) |
||
| 73 | ); |
||
| 74 | |||
| 75 | |||
| 76 | |||
| 77 | |||
| 78 | |||
| 79 | // links |
||
| 80 | $data['updater_update_link'] = $this->url->link('tool/updater/update', 'token=' . $this->session->data['token'], true); |
||
| 81 | |||
| 82 | |||
| 83 | |||
| 84 | |||
| 85 | |||
| 86 | |||
| 87 | |||
| 88 | |||
| 89 | |||
| 90 | |||
| 91 | |||
| 92 | |||
| 93 | |||
| 94 | // page components |
||
| 95 | $data['header'] = $this->load->controller('common/header'); |
||
| 96 | $data['column'] = $this->load->controller('common/column_left'); |
||
| 97 | $data['footer'] = $this->load->controller('common/footer'); |
||
| 98 | |||
| 99 | // render |
||
| 100 | $this->response->setOutput($this->load->view('tool/updater', $data)); |
||
| 101 | } |
||
| 169 |
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