Code Duplication    Length = 4-4 lines in 5 locations

wp-includes/general-template.php 5 locations

@@ 1713-1716 (lines=4) @@
1710
		$query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date $order $limit";
1711
		$key = md5( $query );
1712
		$key = "wp_get_archives:$key:$last_changed";
1713
		if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
1714
			$results = $wpdb->get_results( $query );
1715
			wp_cache_set( $key, $results, 'posts' );
1716
		}
1717
		if ( $results ) {
1718
			$after = $r['after'];
1719
			foreach ( (array) $results as $result ) {
@@ 1736-1739 (lines=4) @@
1733
		$query = "SELECT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date) ORDER BY post_date $order $limit";
1734
		$key = md5( $query );
1735
		$key = "wp_get_archives:$key:$last_changed";
1736
		if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
1737
			$results = $wpdb->get_results( $query );
1738
			wp_cache_set( $key, $results, 'posts' );
1739
		}
1740
		if ( $results ) {
1741
			$after = $r['after'];
1742
			foreach ( (array) $results as $result) {
@@ 1758-1761 (lines=4) @@
1755
		$query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date $order $limit";
1756
		$key = md5( $query );
1757
		$key = "wp_get_archives:$key:$last_changed";
1758
		if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
1759
			$results = $wpdb->get_results( $query );
1760
			wp_cache_set( $key, $results, 'posts' );
1761
		}
1762
		if ( $results ) {
1763
			$after = $r['after'];
1764
			foreach ( (array) $results as $result ) {
@@ 1782-1785 (lines=4) @@
1779
		$query = "SELECT DISTINCT $week AS `week`, YEAR( `post_date` ) AS `yr`, DATE_FORMAT( `post_date`, '%Y-%m-%d' ) AS `yyyymmdd`, count( `ID` ) AS `posts` FROM `$wpdb->posts` $join $where GROUP BY $week, YEAR( `post_date` ) ORDER BY `post_date` $order $limit";
1780
		$key = md5( $query );
1781
		$key = "wp_get_archives:$key:$last_changed";
1782
		if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
1783
			$results = $wpdb->get_results( $query );
1784
			wp_cache_set( $key, $results, 'posts' );
1785
		}
1786
		$arc_w_last = '';
1787
		if ( $results ) {
1788
			$after = $r['after'];
@@ 1813-1816 (lines=4) @@
1810
		$query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit";
1811
		$key = md5( $query );
1812
		$key = "wp_get_archives:$key:$last_changed";
1813
		if ( ! $results = wp_cache_get( $key, 'posts' ) ) {
1814
			$results = $wpdb->get_results( $query );
1815
			wp_cache_set( $key, $results, 'posts' );
1816
		}
1817
		if ( $results ) {
1818
			foreach ( (array) $results as $result ) {
1819
				if ( $result->post_date != '0000-00-00 00:00:00' ) {