Code Duplication    Length = 8-8 lines in 2 locations

packages/sync/src/modules/WooCommerce.php 1 location

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

packages/sync/src/modules/Posts.php 1 location

@@ 207-214 (lines=8) @@
204
	 * @param array $config Full sync configuration for this sync module.
205
	 * @return array Number of items yet to be enqueued.
206
	 */
207
	public function estimate_full_sync_actions( $config ) {
208
		global $wpdb;
209
210
		$query = "SELECT count(*) FROM $wpdb->posts WHERE " . $this->get_where_sql( $config );
211
		// phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared
212
		$count = $wpdb->get_var( $query );
213
214
		return (int) ceil( $count / self::ARRAY_CHUNK_SIZE );
215
	}
216
217
	/**