Code Duplication    Length = 3-3 lines in 5 locations

src/wp-includes/class-wp-comment-query.php 5 locations

@@ 686-688 (lines=3) @@
683
			$this->sql_clauses['where']['post__not_in'] = 'comment_post_ID NOT IN ( ' . implode( ',', wp_parse_id_list( $this->query_vars['post__not_in'] ) ) . ' )';
684
		}
685
686
		if ( '' !== $this->query_vars['author_email'] ) {
687
			$this->sql_clauses['where']['author_email'] = $wpdb->prepare( 'comment_author_email = %s', $this->query_vars['author_email'] );
688
		}
689
690
		if ( '' !== $this->query_vars['author_url'] ) {
691
			$this->sql_clauses['where']['author_url'] = $wpdb->prepare( 'comment_author_url = %s', $this->query_vars['author_url'] );
@@ 690-692 (lines=3) @@
687
			$this->sql_clauses['where']['author_email'] = $wpdb->prepare( 'comment_author_email = %s', $this->query_vars['author_email'] );
688
		}
689
690
		if ( '' !== $this->query_vars['author_url'] ) {
691
			$this->sql_clauses['where']['author_url'] = $wpdb->prepare( 'comment_author_url = %s', $this->query_vars['author_url'] );
692
		}
693
694
		if ( '' !== $this->query_vars['karma'] ) {
695
			$this->sql_clauses['where']['karma'] = $wpdb->prepare( 'comment_karma = %d', $this->query_vars['karma'] );
@@ 694-696 (lines=3) @@
691
			$this->sql_clauses['where']['author_url'] = $wpdb->prepare( 'comment_author_url = %s', $this->query_vars['author_url'] );
692
		}
693
694
		if ( '' !== $this->query_vars['karma'] ) {
695
			$this->sql_clauses['where']['karma'] = $wpdb->prepare( 'comment_karma = %d', $this->query_vars['karma'] );
696
		}
697
698
		// Filtering by comment_type: 'type', 'type__in', 'type__not_in'.
699
		$raw_types = array(
@@ 741-743 (lines=3) @@
738
			$this->query_vars['parent'] = 0;
739
		}
740
741
		if ( '' !== $this->query_vars['parent'] ) {
742
			$this->sql_clauses['where']['parent'] = $wpdb->prepare( 'comment_parent = %d', $this->query_vars['parent'] );
743
		}
744
745
		if ( is_array( $this->query_vars['user_id'] ) ) {
746
			$this->sql_clauses['where']['user_id'] = 'user_id IN (' . implode( ',', array_map( 'absint', $this->query_vars['user_id'] ) ) . ')';
@@ 747-749 (lines=3) @@
744
745
		if ( is_array( $this->query_vars['user_id'] ) ) {
746
			$this->sql_clauses['where']['user_id'] = 'user_id IN (' . implode( ',', array_map( 'absint', $this->query_vars['user_id'] ) ) . ')';
747
		} elseif ( '' !== $this->query_vars['user_id'] ) {
748
			$this->sql_clauses['where']['user_id'] = $wpdb->prepare( 'user_id = %d', $this->query_vars['user_id'] );
749
		}
750
751
		// Falsy search strings are ignored.
752
		if ( strlen( $this->query_vars['search'] ) ) {