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/src/modules/Users.php 1 location

@@ 392-404 (lines=13) @@
389
		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 );
390
	}
391
392
	public function estimate_full_sync_actions( $config ) {
393
		global $wpdb;
394
395
		$query = "SELECT count(*) FROM $wpdb->usermeta";
396
397
		if ( $where_sql = $this->get_where_sql( $config ) ) {
398
			$query .= ' WHERE ' . $where_sql;
399
		}
400
401
		$count = $wpdb->get_var( $query );
402
403
		return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
404
	}
405
406
	private function get_where_sql( $config ) {
407
		global $wpdb;