Code Duplication    Length = 14-15 lines in 2 locations

projects/plugins/jetpack/modules/search/class.jetpack-search.php 2 locations

@@ 1602-1615 (lines=14) @@
1599
1600
						// Let's determine if this term is active or not.
1601
1602
						if ( in_array( $item['key'], $existing_term_slugs, true ) ) {
1603
							$active = true;
1604
1605
							$slug_count = count( $existing_term_slugs );
1606
1607
							if ( $slug_count > 1 ) {
1608
								$remove_url = Jetpack_Search_Helpers::add_query_arg(
1609
									$tax_query_var,
1610
									rawurlencode( implode( '+', array_diff( $existing_term_slugs, array( $item['key'] ) ) ) )
1611
								);
1612
							} else {
1613
								$remove_url = Jetpack_Search_Helpers::remove_query_arg( $tax_query_var );
1614
							}
1615
						}
1616
1617
						break;
1618
@@ 1639-1653 (lines=15) @@
1636
							$post_types = array( $post_types );
1637
						}
1638
1639
						if ( in_array( $item['key'], $post_types, true ) ) {
1640
							$active = true;
1641
1642
							$post_type_count = count( $post_types );
1643
1644
							// For the right 'remove filter' url, we need to remove the post type from the array, or remove the param entirely if it's the only one.
1645
							if ( $post_type_count > 1 ) {
1646
								$remove_url = Jetpack_Search_Helpers::add_query_arg(
1647
									'post_type',
1648
									rawurlencode( implode( ',', array_diff( $post_types, array( $item['key'] ) ) ) )
1649
								);
1650
							} else {
1651
								$remove_url = Jetpack_Search_Helpers::remove_query_arg( 'post_type' );
1652
							}
1653
						}
1654
1655
						break;
1656