| Conditions | 3 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 6 |
| Lines | 3 |
| Ratio | 21.43 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public static function renderOption(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit) |
||
| 26 | { |
||
| 27 | // hide option when disabled and debug mode is off (so that users are not confused) |
||
| 28 | View Code Duplication | if (!XenForo_Application::debugMode() && !$preparedOption['option_value']) { |
|
|
|
|||
| 29 | return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal('threemagateway_option_list_option_hidden', $view, $fieldPrefix, $preparedOption, $canEdit); |
||
| 30 | } |
||
| 31 | |||
| 32 | // set options |
||
| 33 | $preparedOption['edit_format'] = 'onoff'; |
||
| 34 | $preparedOption['formatParams'] = []; |
||
| 35 | |||
| 36 | //pass this to the default handler |
||
| 37 | return XenForo_ViewAdmin_Helper_Option::renderPreparedOptionHtml($view, $preparedOption, $canEdit); |
||
| 38 | } |
||
| 39 | } |
||
| 40 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.