| Conditions | 7 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 11 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | View Code Duplication | function jetpack_twentyeleven_has_footer_widgets() { |
|
|
|
|||
| 35 | // Are any of the "Footer Area" sidebars active? |
||
| 36 | if ( is_active_sidebar( 'sidebar-3' ) || is_active_sidebar( 'sidebar-4' ) || is_active_sidebar( 'sidebar-5' ) ) |
||
| 37 | return true; |
||
| 38 | |||
| 39 | // If we're on mobile and the Main Sidebar has widgets, it falls below the content, so we have footer widgets. |
||
| 40 | if ( function_exists( 'jetpack_is_mobile' ) && jetpack_is_mobile() && is_active_sidebar( 'sidebar-1' ) ) |
||
| 41 | return true; |
||
| 42 | |||
| 43 | return false; |
||
| 44 | } |
||
| 45 |
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.