applications/product/src/org/ofbiz/product/product/ProductWorker.java
ProductWorker
has 124 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public final class ProductWorker {
private static final Debug.OfbizLogger module = Debug.getOfbizLogger(java.lang.invoke.MethodHandles.lookup().lookupClass());
public static final String resource = "ProductUiLabels";
Method getAnyRelatedCategoryIdsForProduct
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static <C extends Collection<String>> C getAnyRelatedCategoryIdsForProduct(C outCategoryIds, Collection<String> outVisitedProductIds, Collection<String> outCatCheckedProductIds, Delegator delegator, String productId, GenericValue product, Collection<GenericValue> productVariantAssocs,
List<GenericValue> productAssocFromList, List<GenericValue> productAssocToList, boolean firstFoundOnly, Timestamp moment, boolean ordered, boolean useCache) throws GenericEntityException {
Method getCategoryIdsForProduct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static <C extends Collection<String>> C getCategoryIdsForProduct(C outCategoryIds, Delegator delegator, String productId, GenericValue product, Collection<GenericValue> productVariantAssocs,
Timestamp moment, boolean ordered, boolean useCache) throws GenericEntityException {
Method getVirtualProductIdsDeepDfs
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static List<String> getVirtualProductIdsDeepDfs(Delegator delegator, LocalDispatcher dispatcher,
String productId, List<String> orderBy, Integer maxPerLevel, Timestamp moment, boolean useCache, List<String> virtualProductIds) throws GeneralException {
Method getTotalIndividualProductStock
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static BigDecimal getTotalIndividualProductStock(Delegator delegator, LocalDispatcher dispatcher,
GenericValue product, Timestamp moment, boolean useCache, String productId, boolean isMarketingPackage, List<GenericValue> productFacilities) throws GeneralException {
Method getAssocCategoryIdsForProduct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static <C extends Collection<String>> C getAssocCategoryIdsForProduct(C outCategoryIds, Delegator delegator, String productId, GenericValue product, Collection<GenericValue> productVariantAssocs,
Timestamp moment, boolean ordered, boolean useCache) throws GenericEntityException {
Method getProductStockPerProductStore
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static Map<String, BigDecimal> getProductStockPerProductStore(Delegator delegator, LocalDispatcher dispatcher,
GenericValue product, Collection<GenericValue> productStores, boolean useTotal, boolean useVariantStockCalcForTotal,
Timestamp moment, boolean useCache) throws GeneralException {
Method getVariantProductIdsDeepDfs
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static List<String> getVariantProductIdsDeepDfs(Delegator delegator, LocalDispatcher dispatcher,
String productId, List<String> orderBy, Timestamp moment, boolean useCache, List<String> variantProductIds) throws GeneralException {
Method getVirtualProducts
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static List<GenericValue> getVirtualProducts(Delegator delegator, LocalDispatcher dispatcher,
GenericValue product, List<String> orderBy, Integer maxResults, Timestamp moment, boolean useCache) throws GeneralException {
Method getVirtualProductIds
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static List<String> getVirtualProductIds(Delegator delegator, LocalDispatcher dispatcher,
String productId, List<String> orderBy, Integer maxResults, Timestamp moment, boolean useCache) throws GeneralException {
Method checkVariantAssocListForAssocCategoryIds
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static Collection<GenericValue> checkVariantAssocListForAssocCategoryIds(Delegator delegator, String productId, GenericValue product, Collection<GenericValue> productVariantAssocs,
Timestamp moment, boolean ordered, boolean useCache) throws GenericEntityException {
Method getIndividualProductStockPerProductStore
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static Map<String, BigDecimal> getIndividualProductStockPerProductStore(Delegator delegator, LocalDispatcher dispatcher,
GenericValue product, Collection<GenericValue> productStores, boolean useTotal, Timestamp moment, boolean useCache) throws GeneralException {
Method getVirtualProductIdsDeepDfs
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static List<String> getVirtualProductIdsDeepDfs(Delegator delegator, LocalDispatcher dispatcher,
String productId, List<String> orderBy, Integer maxPerLevel, Timestamp moment, boolean useCache) throws GeneralException {
Method getOwnCategoryIdsForProduct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static <C extends Collection<String>> C getOwnCategoryIdsForProduct(C outCategoryIds, Delegator delegator, String productId, GenericValue product, Timestamp moment, boolean ordered, boolean useCache) throws GenericEntityException {
Method getVirtualProductsDeepDfs
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static List<GenericValue> getVirtualProductsDeepDfs(Delegator delegator, LocalDispatcher dispatcher,
GenericValue product, List<String> orderBy, Integer maxPerLevel, Timestamp moment, boolean useCache) throws GeneralException {
Avoid deeply nested control flow statements. Open
Open
if ("_total_".equals(entry.getKey())) {
totalInventory = totalInventory.add(entry.getValue());
} else {
BigDecimal storeInventory = countMap.get(entry.getKey());
if (storeInventory == null) storeInventory = BigDecimal.ZERO;
Method getProductCategoryMembers
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static List<GenericValue> getProductCategoryMembers(Delegator delegator, String productId, GenericValue product, Timestamp moment, boolean ordered, boolean useCache) throws GenericEntityException {
Avoid deeply nested control flow statements. Open
Open
if (productFeatureType != null) {
nameBuf.append(productFeatureType.get("description", locale));
nameBuf.append(":");
}
Avoid deeply nested control flow statements. Open
Open
if (availableInventory != null) {
storeInventory = storeInventory.add(availableInventory);
}
Method getProductContentLocalizedSimpleTextViews
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static Map<String, List<GenericValue>> getProductContentLocalizedSimpleTextViews(Delegator delegator, LocalDispatcher dispatcher,
String productId, Collection<String> productContentTypeIdList, java.sql.Timestamp filterByDate, boolean useCache) throws GenericEntityException {
Method getVariantProductIds
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static List<String> getVariantProductIds(Delegator delegator, LocalDispatcher dispatcher,
String productId, List<String> orderBy, Timestamp moment, boolean useCache) throws GeneralException {
Avoid deeply nested control flow statements. Open
Open
if (nameBuf.length() > 0) {
nameBuf.append(", ");
}
Method getVariantProductIdsDeepDfs
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static List<String> getVariantProductIdsDeepDfs(Delegator delegator, LocalDispatcher dispatcher,
String productId, List<String> orderBy, Timestamp moment, boolean useCache) throws GeneralException {
Avoid deeply nested control flow statements. Open
Open
if (featurTo.equals(paramValueTo)) {
found = true;
break;
}
Method getVariantProducts
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static List<GenericValue> getVariantProducts(Delegator delegator, LocalDispatcher dispatcher,
GenericValue product, List<String> orderBy, Timestamp moment, boolean useCache) throws GeneralException {
Avoid deeply nested control flow statements. Open
Open
if (productFeaturePrice != null) {
productPrice.put("price", productPrice.getBigDecimal("price").add(productFeaturePrice.getBigDecimal("price")));
}
Avoid deeply nested control flow statements. Open
Open
if (!ServiceUtil.isSuccess(resultOutput)) {
Debug.logWarning("Error getting available marketing package.", module);
}
Method getVariantProductsDeepDfs
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static List<GenericValue> getVariantProductsDeepDfs(Delegator delegator, LocalDispatcher dispatcher,
GenericValue product, List<String> orderBy, Timestamp moment, boolean useCache) throws GeneralException {
Method filterOrderAdjustments
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static List<GenericValue> filterOrderAdjustments(List<GenericValue> adjustments, boolean includeOther, boolean includeTax, boolean includeShipping, boolean forTax, boolean forShipping) {
Method getProductStockForProductStore
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static BigDecimal getProductStockForProductStore(Delegator delegator, LocalDispatcher dispatcher,
GenericValue product, GenericValue productStore,
Timestamp moment, boolean useCache) throws GeneralException {
Avoid deeply nested control flow statements. Open
Open
if (featurTo.equals(paramValueTo)) {
Debug.logWarning("Incompatible features", module);
return null;
}
Method getAverageProductRating
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static BigDecimal getAverageProductRating(GenericValue product, List<GenericValue> reviews, String productStoreId, BigDecimal defaultRating, boolean useCache) { // SCIPIO: Added defaultRating, useCache
Method getProductCategoryMembersSafe
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static List<GenericValue> getProductCategoryMembersSafe(Delegator delegator, String productId, Timestamp moment, boolean ordered, boolean useCache) {
Method getTotalIndividualProductStock
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static BigDecimal getTotalIndividualProductStock(Delegator delegator, LocalDispatcher dispatcher,
GenericValue product, Timestamp moment, boolean useCache) throws GeneralException {
Method getProductCategoryMembers
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static List<GenericValue> getProductCategoryMembers(Delegator delegator, String productId, Timestamp moment, boolean ordered, boolean useCache) throws GenericEntityException {
Method getVariantProductsForStockCalc
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static List<GenericValue> getVariantProductsForStockCalc(Delegator delegator, LocalDispatcher dispatcher,
GenericValue product, Timestamp moment, boolean useCache) throws GeneralException {
Method getAssocCategoryIdsForProduct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static <C extends Collection<String>> C getAssocCategoryIdsForProduct(C outCategoryIds, GenericValue product,
Timestamp moment, boolean ordered, boolean useCache) throws GenericEntityException {
Method getOwnCategoryIdsForProduct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static <C extends Collection<String>> C getOwnCategoryIdsForProduct(C outCategoryIds, GenericValue product, Timestamp moment, boolean ordered, boolean useCache) throws GenericEntityException {
Method findProductsById
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static List<GenericValue> findProductsById(Delegator delegator,
String idToFind, String goodIdentificationTypeId,
boolean searchProductFirst, boolean searchAllId) throws GenericEntityException {
Method calcOrderAdjustments
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static BigDecimal calcOrderAdjustments(List<GenericValue> orderHeaderAdjustments, BigDecimal subTotal, boolean includeOther, boolean includeTax, boolean includeShipping) {
Method getOwnCategoryIdsForProduct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static <C extends Collection<String>> C getOwnCategoryIdsForProduct(C outCategoryIds, Delegator delegator, String productId, GenericValue product, List<GenericValue> productCategoryMembers) throws GenericEntityException {
Method getCategoryIdsForProduct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static <C extends Collection<String>> C getCategoryIdsForProduct(C outCategoryIds, GenericValue product, Timestamp moment, boolean ordered, boolean useCache) throws GenericEntityException {
Avoid too many return
statements within this method. Open
Open
return outCategoryIds;
Avoid too many return
statements within this method. Open
Open
return outCategoryIds;
Avoid too many return
statements within this method. Open
Open
return outCategoryIds;
Avoid too many return
statements within this method. Open
Open
return false;