Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Lines | 19 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
35 | View Code Duplication | function give_get_current_setting_section() { |
|
36 | // Get current tab. |
||
37 | $current_tab = give_get_current_setting_tab(); |
||
38 | |||
39 | /** |
||
40 | * Filter the default section for current setting page tab. |
||
41 | * |
||
42 | * @since 1.8 |
||
43 | * |
||
44 | * @param string |
||
45 | */ |
||
46 | $default_current_section = apply_filters( "give_default_setting_tab_section_{$current_tab}", '' ); |
||
47 | |||
48 | // Get current section. |
||
49 | $current_section = empty( $_REQUEST['section'] ) ? $default_current_section : urldecode( $_REQUEST['section'] ); |
||
50 | |||
51 | // Output. |
||
52 | return $current_section; |
||
53 | } |
||
54 | |||
68 |
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.