Conditions | 2 |
Paths | 2 |
Total Lines | 52 |
Code Lines | 31 |
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 namespace crocodicstudio\crudbooster\controllers; |
||
13 | public function cbInit() |
||
14 | { |
||
15 | $this->module_name = "Settings"; |
||
16 | $this->table = 'cms_settings'; |
||
17 | $this->primary_key = 'id'; |
||
18 | $this->title_field = "name"; |
||
19 | $this->index_orderby = ['name' => 'asc']; |
||
20 | $this->button_delete = true; |
||
21 | $this->button_show = false; |
||
22 | $this->button_cancel = false; |
||
23 | $this->button_import = false; |
||
24 | $this->button_export = false; |
||
25 | |||
26 | $this->col = []; |
||
27 | $this->col[] = ["label" => "Nama", "name" => "name", "callback_php" => "ucwords(str_replace('_',' ',%field%))"]; |
||
28 | $this->col[] = ["label" => "Setting", "name" => "content"]; |
||
29 | |||
30 | $this->form = []; |
||
31 | |||
32 | if (Request::get('group_setting')) { |
||
33 | $value = Request::get('group_setting'); |
||
34 | } else { |
||
35 | $value = 'General Setting'; |
||
36 | } |
||
37 | |||
38 | $this->form[] = ['label' => 'Group', 'name' => 'group_setting', 'value' => $value]; |
||
39 | $this->form[] = ['label' => 'Label', 'name' => 'label']; |
||
40 | |||
41 | $this->form[] = [ |
||
42 | "label" => "Type", |
||
43 | "name" => "content_input_type", |
||
44 | "type" => "select", |
||
45 | "dataenum" => ["text", "number", "email", "textarea", "wysiwyg", "upload_image", "upload_document", "datepicker", "radio", "select"], |
||
46 | ]; |
||
47 | $this->form[] = [ |
||
48 | "label" => "Radio / Select Data", |
||
49 | "name" => "dataenum", |
||
50 | "placeholder" => "Example : abc,def,ghi", |
||
51 | "jquery" => " |
||
52 | function show_radio_data() { |
||
53 | var cit = $('#content_input_type').val(); |
||
54 | if(cit == 'radio' || cit == 'select') { |
||
55 | $('#form-group-dataenum').show(); |
||
56 | }else{ |
||
57 | $('#form-group-dataenum').hide(); |
||
58 | } |
||
59 | } |
||
60 | $('#content_input_type').change(show_radio_data); |
||
61 | show_radio_data(); |
||
62 | ", |
||
63 | ]; |
||
64 | $this->form[] = ["label" => "Helper Text", "name" => "helper", "type" => "text"]; |
||
65 | } |
||
159 |
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