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

@@ 228-236 (lines=9) @@
225
	 * @param array $config Full sync configuration for this sync module.
226
	 * @return array Number of items yet to be enqueued.
227
	 */
228
	public function estimate_full_sync_actions( $config ) {
229
		global $wpdb;
230
231
		$query = "SELECT count(*) FROM $wpdb->posts WHERE " . $this->get_where_sql( $config );
232
		// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
233
		$count = $wpdb->get_var( $query );
234
235
		return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
236
	}
237
238
	/**
239
	 * Retrieve the WHERE SQL clause based on the module config.