Code Duplication    Length = 5-7 lines in 4 locations

src/wp-includes/class-wp-comment-query.php 1 location

@@ 644-650 (lines=7) @@
641
		$number = absint( $this->query_vars['number'] );
642
		$offset = absint( $this->query_vars['offset'] );
643
644
		if ( ! empty( $number ) ) {
645
			if ( $offset ) {
646
				$limits = 'LIMIT ' . $offset . ',' . $number;
647
			} else {
648
				$limits = 'LIMIT ' . $number;
649
			}
650
		}
651
652
		if ( $this->query_vars['count'] ) {
653
			$fields = 'COUNT(*)';

src/wp-includes/class-wp-network-query.php 1 location

@@ 335-341 (lines=7) @@
332
		$number = absint( $this->query_vars['number'] );
333
		$offset = absint( $this->query_vars['offset'] );
334
335
		if ( ! empty( $number ) ) {
336
			if ( $offset ) {
337
				$limits = 'LIMIT ' . $offset . ',' . $number;
338
			} else {
339
				$limits = 'LIMIT ' . $number;
340
			}
341
		}
342
343
		if ( $this->query_vars['count'] ) {
344
			$fields = 'COUNT(*)';

src/wp-includes/class-wp-site-query.php 1 location

@@ 382-388 (lines=7) @@
379
		$number = absint( $this->query_vars['number'] );
380
		$offset = absint( $this->query_vars['offset'] );
381
382
		if ( ! empty( $number ) ) {
383
			if ( $offset ) {
384
				$limits = 'LIMIT ' . $offset . ',' . $number;
385
			} else {
386
				$limits = 'LIMIT ' . $number;
387
			}
388
		}
389
390
		if ( $this->query_vars['count'] ) {
391
			$fields = 'COUNT(*)';

src/wp-includes/class-wp-term-query.php 1 location

@@ 556-560 (lines=5) @@
553
554
		// Don't limit the query results when we have to descend the family tree.
555
		if ( $number && ! $hierarchical && ! $child_of && '' === $parent ) {
556
			if ( $offset ) {
557
				$limits = 'LIMIT ' . $offset . ',' . $number;
558
			} else {
559
				$limits = 'LIMIT ' . $number;
560
			}
561
		} else {
562
			$limits = '';
563
		}