Code Duplication    Length = 9-9 lines in 2 locations

projects/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.

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

@@ 253-261 (lines=9) @@
250
	 * @param array $config Full sync configuration for this sync module.
251
	 * @return array Number of items yet to be enqueued.
252
	 */
253
	public function estimate_full_sync_actions( $config ) {
254
		global $wpdb;
255
256
		$query = "SELECT count(*) FROM $wpdb->posts WHERE " . $this->get_where_sql( $config );
257
		// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
258
		$count = $wpdb->get_var( $query );
259
260
		return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
261
	}
262
263
	/**
264
	 * Retrieve the WHERE SQL clause based on the module config.