| Conditions | 3 |
| Paths | 3 |
| Total Lines | 56 |
| 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 |
||
| 16 | public function edit(Request $request) |
||
| 17 | { |
||
| 18 | $this->setAdminPrefs(); |
||
| 19 | |||
| 20 | // Set the current action. |
||
| 21 | $action = $request->input('action') ?? 'view'; |
||
| 22 | |||
| 23 | switch ($action) { |
||
| 24 | case 'submit': |
||
| 25 | Settings::settingsUpdate($request->all()); |
||
| 26 | $meta_title = $title = 'Tmux Settings Edit'; |
||
| 27 | $this->smarty->assign('site', $this->settings); |
||
|
|
|||
| 28 | break; |
||
| 29 | |||
| 30 | case 'view': |
||
| 31 | default: |
||
| 32 | $meta_title = $title = 'Tmux Settings Edit'; |
||
| 33 | $this->smarty->assign('site', $this->settings); |
||
| 34 | break; |
||
| 35 | } |
||
| 36 | |||
| 37 | $this->smarty->assign('yesno_ids', [1, 0]); |
||
| 38 | $this->smarty->assign('yesno_names', ['yes', 'no']); |
||
| 39 | |||
| 40 | $this->smarty->assign('backfill_ids', [0, 4, 1]); |
||
| 41 | $this->smarty->assign('backfill_names', ['Disabled', 'Safe', 'All']); |
||
| 42 | $this->smarty->assign('backfill_group_ids', [1, 2, 3, 4, 5, 6]); |
||
| 43 | $this->smarty->assign('backfill_group', ['Newest', 'Oldest', 'Alphabetical', 'Alphabetical - Reverse', 'Most Posts', 'Fewest Posts']); |
||
| 44 | $this->smarty->assign('backfill_days', ['Days per Group', 'Safe Backfill day']); |
||
| 45 | $this->smarty->assign('backfill_days_ids', [1, 2]); |
||
| 46 | $this->smarty->assign('dehash_ids', [0, 1]); |
||
| 47 | $this->smarty->assign('dehash_names', ['Disabled', 'Enabled']); |
||
| 48 | $this->smarty->assign('import_ids', [0, 1, 2]); |
||
| 49 | $this->smarty->assign('import_names', ['Disabled', 'Import - Do Not Use Filenames', 'Import - Use Filenames']); |
||
| 50 | $this->smarty->assign('releases_ids', [0, 1]); |
||
| 51 | $this->smarty->assign('releases_names', ['Disabled', 'Update Releases']); |
||
| 52 | $this->smarty->assign('post_ids', [0, 1, 2, 3]); |
||
| 53 | $this->smarty->assign('post_names', ['Disabled', 'PostProcess Additional', 'PostProcess NFOs', 'All']); |
||
| 54 | $this->smarty->assign('fix_crap_radio_ids', ['Disabled', 'All', 'Custom']); |
||
| 55 | $this->smarty->assign('fix_crap_radio_names', ['Disabled', 'All', 'Custom']); |
||
| 56 | $this->smarty->assign('fix_crap_check_ids', ['blacklist', 'blfiles', 'executable', 'gibberish', 'hashed', 'installbin', 'passworded', 'passwordurl', 'sample', 'scr', 'short', 'size', 'huge', 'nzb', 'codec']); |
||
| 57 | $this->smarty->assign('fix_crap_check_names', ['blacklist', 'blfiles', 'executable', 'gibberish', 'hashed', 'installbin', 'passworded', 'passwordurl', 'sample', 'scr', 'short', 'size', 'huge', 'nzb', 'codec']); |
||
| 58 | $this->smarty->assign('sequential_ids', [0, 1]); |
||
| 59 | $this->smarty->assign('sequential_names', ['Disabled', 'Enabled']); |
||
| 60 | $this->smarty->assign('binaries_ids', [0, 1]); |
||
| 61 | $this->smarty->assign('binaries_names', ['Disabled', 'Enabled']); |
||
| 62 | $this->smarty->assign('lookup_reqids_ids', [0, 1, 2]); |
||
| 63 | $this->smarty->assign('lookup_reqids_names', ['Disabled', 'Lookup Request IDs', 'Lookup Request IDs Threaded']); |
||
| 64 | $this->smarty->assign('predb_ids', [0, 1]); |
||
| 65 | $this->smarty->assign('predb_names', ['Disabled', 'Enabled']); |
||
| 66 | |||
| 67 | $content = $this->smarty->fetch('tmux-edit.tpl'); |
||
| 68 | |||
| 69 | $this->smarty->assign(compact('title', 'meta_title', 'content')); |
||
| 70 | |||
| 71 | $this->adminrender(); |
||
| 72 | } |
||
| 74 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.