Code Duplication    Length = 9-9 lines in 2 locations

packages/sync/src/modules/class-woocommerce.php 1 location

@@ 266-274 (lines=9) @@
263
	 * @param array $config Full sync configuration for this sync module.
264
	 * @return array Number of items yet to be enqueued.
265
	 */
266
	public function estimate_full_sync_actions( $config ) {
267
		global $wpdb;
268
269
		$query = "SELECT count(*) FROM $this->order_item_table_name WHERE " . $this->get_where_sql( $config );
270
		// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
271
		$count = $wpdb->get_var( $query );
272
273
		return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
274
	}
275
276
	/**
277
	 * Retrieve the WHERE SQL clause based on the module config.

packages/sync/src/modules/class-posts.php 1 location

@@ 219-227 (lines=9) @@
216
	 * @param array $config Full sync configuration for this sync module.
217
	 * @return array Number of items yet to be enqueued.
218
	 */
219
	public function estimate_full_sync_actions( $config ) {
220
		global $wpdb;
221
222
		$query = "SELECT count(*) FROM $wpdb->posts WHERE " . $this->get_where_sql( $config );
223
		// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
224
		$count = $wpdb->get_var( $query );
225
226
		return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
227
	}
228
229
	/**
230
	 * Retrieve the WHERE SQL clause based on the module config.