Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit 5762422

Browse files
committed
Decrease Cyclomatic Complexity
1 parent f6b7810 commit 5762422

File tree

1 file changed

+10
-3
lines changed
  • plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/network/rest/wpcom/wc/product

1 file changed

+10
-3
lines changed

plugins/woocommerce/src/main/kotlin/org/wordpress/android/fluxc/network/rest/wpcom/wc/product/ProductRestClient.kt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -654,13 +654,20 @@ class ProductRestClient @Inject constructor(
654654
}
655655
}
656656

657-
if (globalUniqueIdSearchQuery.isNullOrEmpty().not()) {
658-
params["global_unique_id"] = globalUniqueIdSearchQuery!!
659-
}
657+
addGlobalUniqueIdSearchQuery(params, globalUniqueIdSearchQuery)
660658

661659
return params
662660
}
663661

662+
private fun addGlobalUniqueIdSearchQuery(
663+
params: MutableMap<String, String>,
664+
globalUniqueIdSearchQuery: String?
665+
) {
666+
if (!globalUniqueIdSearchQuery.isNullOrEmpty()) {
667+
params["global_unique_id"] = globalUniqueIdSearchQuery
668+
}
669+
}
670+
664671
/**
665672
* Makes a GET request to `/wp-json/wc/v3/products/categories` retrieving a list of product
666673
* categories for the given WooCommerce [SiteModel].

0 commit comments

Comments
 (0)