Code Duplication    Length = 10-12 lines in 2 locations

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

@@ 261-272 (lines=12) @@
258
		return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
259
	}
260
261
	private function get_where_sql( $config ) {
262
		global $wpdb;
263
264
		$query = "meta_key = '{$wpdb->prefix}capabilities'";
265
266
		// config is a list of user IDs to sync
267
		if ( is_array( $config ) ) {
268
			$query .= ' AND user_id IN (' . implode( ',', array_map( 'intval', $config ) ) . ')';
269
		}
270
271
		return $query;
272
	}
273
274
	function get_full_sync_actions() {
275
		return array( 'jetpack_full_sync_users' );

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

@@ 74-83 (lines=10) @@
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();
76
77
		// config is a list of post IDs to sync
78
		if ( is_array( $config ) ) {
79
			$where_sql .= ' AND ID IN (' . implode( ',', array_map( 'intval', $config ) ) . ')';
80
		}
81
82
		return $where_sql;
83
	}
84
85
	function get_full_sync_actions() {
86
		return array( 'jetpack_full_sync_posts' );