Code Duplication    Length = 10-12 lines in 2 locations

packages/sync/Module_Posts.php 1 location

@@ 94-103 (lines=10) @@
91
		return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
92
	}
93
94
	private function get_where_sql( $config ) {
95
		$where_sql = Settings::get_blacklisted_post_types_sql();
96
97
		// config is a list of post IDs to sync
98
		if ( is_array( $config ) ) {
99
			$where_sql .= ' AND ID IN (' . implode( ',', array_map( 'intval', $config ) ) . ')';
100
		}
101
102
		return $where_sql;
103
	}
104
105
	function get_full_sync_actions() {
106
		return array( 'jetpack_full_sync_posts' );

packages/sync/Module_Users.php 1 location

@@ 404-415 (lines=12) @@
401
		return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
402
	}
403
404
	private function get_where_sql( $config ) {
405
		global $wpdb;
406
407
		$query = "meta_key = '{$wpdb->prefix}capabilities'";
408
409
		// config is a list of user IDs to sync
410
		if ( is_array( $config ) ) {
411
			$query .= ' AND user_id IN (' . implode( ',', array_map( 'intval', $config ) ) . ')';
412
		}
413
414
		return $query;
415
	}
416
417
	function get_full_sync_actions() {
418
		return array( 'jetpack_full_sync_users' );