Code Duplication    Length = 8-8 lines in 2 locations

sync/class.jetpack-sync-module-posts.php 1 location

@@ 65-72 (lines=8) @@
62
		return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_posts', $wpdb->posts, 'ID', $this->get_where_sql( $config ), $max_items_to_enqueue, $state );
63
	}
64
65
	public function estimate_full_sync_actions( $config ) {
66
		global $wpdb;
67
68
		$query = "SELECT count(*) FROM $wpdb->posts WHERE " . $this->get_where_sql( $config );
69
		$count = $wpdb->get_var( $query );
70
71
		return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
72
	}
73
74
	private function get_where_sql( $config ) {
75
		$where_sql = Jetpack_Sync_Settings::get_blacklisted_post_types_sql();

sync/class.jetpack-sync-module-woocommerce.php 1 location

@@ 127-134 (lines=8) @@
124
		return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_woocommerce_order_items', $this->order_item_table_name, 'order_item_id', $this->get_where_sql( $config ), $max_items_to_enqueue, $state );
125
	}
126
127
	public function estimate_full_sync_actions( $config ) {
128
		global $wpdb;
129
130
		$query = "SELECT count(*) FROM $this->order_item_table_name WHERE " . $this->get_where_sql( $config );
131
		$count = $wpdb->get_var( $query );
132
133
		return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
134
	}
135
136
	private function get_where_sql( $config ) {
137
		return '1=1';