applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
CheckOutHelper
has 44 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class CheckOutHelper {
private static final Debug.OfbizLogger module = Debug.getOfbizLogger(java.lang.invoke.MethodHandles.lookup().lookupClass());
public static final String resource = "OrderUiLabels";
public static final String resource_error = "OrderErrorUiLabels";
Method setCheckOutOptions
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public Map<String, Object> setCheckOutOptions(String shippingMethod, String shippingContactMechId, Map<String, Map<String, Object>> selectedPaymentMethods,
List<String> singleUsePayments, String billingAccountId, String shippingInstructions,
String orderAdditionalEmails, String maySplit, String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate) {
Method finalizeOrderEntryOptions
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public Map<String, Object> finalizeOrderEntryOptions(int shipGroupIndex, String shippingMethod, String shippingInstructions, String maySplit,
String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate, String internalOrderNotes, String shippingNotes, BigDecimal shipEstimate) {
Method finalizeOrderEntryOptions
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public Map<String, Object> finalizeOrderEntryOptions(int shipGroupIndex, String shippingMethod, String shippingInstructions, String maySplit,
String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate, String internalOrderNotes, String shippingNotes) {
Method processPayment
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static Map<String, Object> processPayment(String orderId, BigDecimal orderTotal, String currencyUomId, GenericValue productStore, GenericValue userLogin, boolean faceToFace, boolean manualHold,
LocalDispatcher dispatcher, Delegator delegator, Locale locale) throws GeneralException { // SCIPIO: 2019-03-07: Added locale
Method finalizeOrderEntryOptions
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public Map<String, Object> finalizeOrderEntryOptions(int shipGroupIndex, String shippingMethod, String shippingInstructions, String maySplit,
String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate, String orderAdditionalEmails) {
Method processPayment
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static Map<String, Object> processPayment(String orderId, BigDecimal orderTotal, String currencyUomId, GenericValue productStore, GenericValue userLogin, boolean faceToFace, boolean manualHold,
LocalDispatcher dispatcher, Delegator delegator) throws GeneralException {
Method setCheckOutShippingOptionsInternal
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private List<String> setCheckOutShippingOptionsInternal(String shippingMethod, String shippingInstructions, String orderAdditionalEmails,
String maySplit, String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate) {
Method setCheckOutShippingOptions
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public Map<String, Object> setCheckOutShippingOptions(String shippingMethod, String shippingInstructions,
String orderAdditionalEmails, String maySplit, String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate) {
Method processPayment
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public Map<String, Object> processPayment(String orderId, BigDecimal orderTotal, String currencyUomId, GenericValue productStore, GenericValue userLogin, boolean faceToFace, boolean manualHold) throws GeneralException {
Method createOrder
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public Map<String, Object> createOrder(GenericValue userLogin, String distributorId, String affiliateId,
List<GenericValue> trackingCodeOrders, boolean areOrderItemsExploded, String visitId, String webSiteId) {
Avoid deeply nested control flow statements. Open
Open
if (!cart.hasOrderTerm(billingAccountTerm.getString("termTypeId"))) {
cart.addOrderTerm(billingAccountTerm.getString("termTypeId"), billingAccountTerm.getBigDecimal("termValue"), billingAccountTerm.getLong("termDays"));
}
Avoid deeply nested control flow statements. Open
Open
if (!ok) {
throw new GeneralException("Problem with order change; see above error");
}
Avoid deeply nested control flow statements. Open
Open
if (UtilValidate.isEmail(email)) {
res.add(email);
} else {
errorMessages.add(UtilProperties.getMessage(resource_error, "checkhelper.value_not_valid_email", UtilMisc.toMap("email", email), (cart != null ? cart.getLocale() : Locale.getDefault())));
}
Avoid deeply nested control flow statements. Open
Open
if (gcAmount.compareTo(BigDecimal.ZERO) > 0) {
giftCardAmount = gcAmount;
}
Method adjustFaceToFacePayment
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static void adjustFaceToFacePayment(String orderId, BigDecimal cartTotal, List<GenericValue> allPaymentPrefs, GenericValue userLogin, Delegator delegator) throws GeneralException {
Method makeTaxContext
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private Map<String, Object> makeTaxContext(int shipGroup, GenericValue shipAddress, Map<Integer, ShoppingCartItem> shoppingCartItemIndexMap, String originFacilityId, boolean skipEmptyAddresses) {
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(errMsg);
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(getStoreAuthMsg(productStore, "authErrorMessage", locale)); // SCIPIO: Refactored: ERROR_MESSAGE
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(messages);
Avoid too many return
statements within this method. Open
Open
return result;
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnSuccess();
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(serviceResult));
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(errMsg);
Avoid too many return
statements within this method. Open
Open
return result;
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(errMsg);
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnSuccess("success");
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(messages);
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(getStoreAuthMsg(productStore, "authDeclinedMessage", locale)); // SCIPIO: Refactored: DECLINE_MESSAGE
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnFailure(UtilProperties.getMessage(resource_error,"OrderFailed", cart.getLocale()));
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnSuccess();