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

@@ 328-336 (lines=9) @@
325
	 * @param array $config Full sync configuration for this sync module.
326
	 * @return array Number of items yet to be enqueued.
327
	 */
328
	public function estimate_full_sync_actions( $config ) {
329
		global $wpdb;
330
331
		$query = "SELECT count(*) FROM $wpdb->posts WHERE " . $this->get_where_sql( $config );
332
		// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
333
		$count = $wpdb->get_var( $query );
334
335
		return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
336
	}
337
338
	/**
339
	 * Retrieve the WHERE SQL clause based on the module config.