Code Duplication    Length = 13-13 lines in 2 locations

packages/sync/legacy/class.jetpack-sync-module-comments.php 1 location

@@ 105-117 (lines=13) @@
102
		return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_comments', $wpdb->comments, 'comment_ID', $this->get_where_sql( $config ), $max_items_to_enqueue, $state );
103
	}
104
105
	public function estimate_full_sync_actions( $config ) {
106
		global $wpdb;
107
108
		$query = "SELECT count(*) FROM $wpdb->comments";
109
110
		if ( $where_sql = $this->get_where_sql( $config ) ) {
111
			$query .= ' WHERE ' . $where_sql;
112
		}
113
114
		$count = $wpdb->get_var( $query );
115
116
		return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
117
	}
118
119
	private function get_where_sql( $config ) {
120
		if ( is_array( $config ) ) {

packages/sync/legacy/class.jetpack-sync-module-users.php 1 location

@@ 390-402 (lines=13) @@
387
		return $this->enqueue_all_ids_as_action( 'jetpack_full_sync_users', $wpdb->usermeta, 'user_id', $this->get_where_sql( $config ), $max_items_to_enqueue, $state );
388
	}
389
390
	public function estimate_full_sync_actions( $config ) {
391
		global $wpdb;
392
393
		$query = "SELECT count(*) FROM $wpdb->usermeta";
394
395
		if ( $where_sql = $this->get_where_sql( $config ) ) {
396
			$query .= ' WHERE ' . $where_sql;
397
		}
398
399
		$count = $wpdb->get_var( $query );
400
401
		return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
402
	}
403
404
	private function get_where_sql( $config ) {
405
		global $wpdb;