applications/product/src/org/ofbiz/product/price/PriceServices.java
Method calcPriceResultFromRules
has 21 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static Map<String, Object> calcPriceResultFromRules(List<GenericValue> productPriceRules, BigDecimal listPrice, BigDecimal defaultPrice, BigDecimal promoPrice,
BigDecimal wholesalePrice, GenericValue maximumPriceValue, GenericValue minimumPriceValue, boolean validPriceFound,
GenericValue averageCostValue, String productId, String virtualProductId, String prodCatalogId, String productStoreGroupId,
String webSiteId, String partyId, BigDecimal quantity, String currencyUomId, Delegator delegator, Timestamp nowTimestamp,
Locale locale, boolean useCache) throws GenericEntityException {
Method calcPriceResultFromRules
has 20 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static Map<String, Object> calcPriceResultFromRules(List<GenericValue> productPriceRules, BigDecimal listPrice, BigDecimal defaultPrice, BigDecimal promoPrice,
BigDecimal wholesalePrice, GenericValue maximumPriceValue, GenericValue minimumPriceValue, boolean validPriceFound,
GenericValue averageCostValue, String productId, String virtualProductId, String prodCatalogId, String productStoreGroupId,
String webSiteId, String partyId, BigDecimal quantity, String currencyUomId, Delegator delegator, Timestamp nowTimestamp,
Locale locale) throws GenericEntityException {
Method checkPriceCondition
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static boolean checkPriceCondition(GenericValue productPriceCond, String productId, String virtualProductId, String prodCatalogId,
String productStoreGroupId, String webSiteId, String partyId, BigDecimal quantity, BigDecimal listPrice,
String currencyUomId, Delegator delegator, Timestamp nowTimestamp, boolean useCache) throws GenericEntityException {
Method checkPriceCondition
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static boolean checkPriceCondition(GenericValue productPriceCond, String productId, String virtualProductId, String prodCatalogId,
String productStoreGroupId, String webSiteId, String partyId, BigDecimal quantity, BigDecimal listPrice,
String currencyUomId, Delegator delegator, Timestamp nowTimestamp) throws GenericEntityException {
Method addGeneralResults
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static Map<String, Object> addGeneralResults(Map<String, Object> result, GenericValue competitivePriceValue, GenericValue specialPromoPriceValue, GenericValue productStore,
String checkIncludeVat, String currencyUomId, String productId, BigDecimal quantity, String partyId, LocalDispatcher dispatcher, Locale locale, boolean useCache) {
Method addGeneralResults
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static Map<String, Object> addGeneralResults(Map<String, Object> result, GenericValue competitivePriceValue, GenericValue specialPromoPriceValue, GenericValue productStore,
String checkIncludeVat, String currencyUomId, String productId, BigDecimal quantity, String partyId, LocalDispatcher dispatcher, Locale locale) {
Method makeProducePriceRuleList
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static List<GenericValue> makeProducePriceRuleList(Delegator delegator, boolean optimizeForLargeRuleSet, String productId, String virtualProductId, String prodCatalogId, String productStoreGroupId, String webSiteId, String partyId, String currencyUomId, boolean useCache) throws GenericEntityException {
Method makeProducePriceRuleList
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static List<GenericValue> makeProducePriceRuleList(Delegator delegator, boolean optimizeForLargeRuleSet, String productId, String virtualProductId, String prodCatalogId, String productStoreGroupId, String webSiteId, String partyId, String currencyUomId) throws GenericEntityException {
Avoid deeply nested control flow statements. Open
Open
if (productPriceAction.get("amount") != null) {
modifyAmount = defaultPrice.multiply(productPriceAction.getBigDecimal("amount").movePointLeft(2));
price = defaultPrice;
}
Avoid deeply nested control flow statements. Open
Open
if (minDefaultPrice == null || curDefaultPrice.compareTo(minDefaultPrice) < 0) {
// check to see if the product is discontinued for sale before considering it the lowest price
GenericValue curVariantProduct = EntityQuery.use(delegator).from("Product").where("productId", curVariantProductId).cache(useCache).queryOne();
if (curVariantProduct != null) {
Timestamp salesDiscontinuationDate = curVariantProduct.getTimestamp("salesDiscontinuationDate");
Avoid deeply nested control flow statements. Open
Open
if (UtilValidate.isNotEmpty(calculatedDefaultPrice)) {
defaultPrice = calculatedDefaultPrice;
validPriceFound = true;
}
Avoid deeply nested control flow statements. Open
Open
switch (entry.getKey()) {
case "basePrice":
tempPrice = (BigDecimal) entry.getValue();
break;
case "price":
Avoid deeply nested control flow statements. Open
Open
if (tempPrice != null && tempPrice != BigDecimal.ZERO) {
Map<String, Object> priceResults = new HashMap<String, Object>();
try {
priceResults = dispatcher.runSync("convertUom", UtilMisc.<String, Object> toMap("uomId", currencyDefaultUomId, "uomIdTo", currencyUomIdTo,
"originalValue", tempPrice, "defaultDecimalScale", 2L, "defaultRoundingMode", "HalfUp"));
Method checkConditionPartyHierarchy
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static int checkConditionPartyHierarchy(Delegator delegator, Timestamp nowTimestamp, String groupPartyId, String partyId, boolean useCache) throws GenericEntityException {
Avoid too many return
statements within this method. Open
Open
if (errorResult != null) return errorResult;
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ProductPriceCannotRetrievePriceRules", UtilMisc.toMap("errorString", e.toString()) , locale));
Avoid too many return
statements within this method. Open
Open
if (errorResult != null) return errorResult;
Avoid too many return
statements within this method. Open
Open
if (compare <= 0) return true;
Avoid too many return
statements within this method. Open
Open
if (quantErrorResult != null) return quantErrorResult;
Avoid too many return
statements within this method. Open
Open
return result;
Avoid too many return
statements within this method. Open
Open
if (compare > 0) return true;
Avoid too many return
statements within this method. Open
Open
if (errorResult != null) return errorResult;
Avoid too many return
statements within this method. Open
Open
if (compare == 0) return true;
Avoid too many return
statements within this method. Open
Open
if (compare != 0) return true;
Avoid too many return
statements within this method. Open
Open
return false;
Avoid too many return
statements within this method. Open
Open
if (compare < 0) return true;