applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
ShoppingCart
has 439 methods (exceeds 20 allowed). Consider refactoring. Open
Open
@SuppressWarnings("serial")
public class ShoppingCart implements Iterable<ShoppingCartItem>, Serializable {
private static final Debug.OfbizLogger module = Debug.getOfbizLogger(java.lang.invoke.MethodHandles.lookup().lookupClass());
public static final String resource_error = "OrderErrorUiLabels";
CartShipInfo
has 38 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public static class CartShipInfo implements Serializable {
// SCIPIO: 2018-11-22: Defaults moved into constructor
public Map<ShoppingCartItem, CartShipItemInfo> shipItemInfo;
public List<GenericValue> shipTaxAdj;
public String orderTypeId;
Method makeItem
has 26 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public ShoppingCartItem makeItem(Integer cartLocation, GenericValue product, BigDecimal selectedAmount,
BigDecimal quantity, BigDecimal unitPrice, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons,
String accommodationMapId,String accommodationSpotId,
Timestamp shipBeforeDate, Timestamp shipAfterDate, Map<String, GenericValue> additionalProductFeatureAndAppls, Map<String, Object> attributes,
String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, LocalDispatcher dispatcher,
Method addItemToEnd
has 19 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public int addItemToEnd(String productId, BigDecimal amount, BigDecimal quantity, BigDecimal unitPrice, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersonsDbl,String accommodationMapId, String accommodationSpotId, HashMap<String, GenericValue> features, HashMap<String, Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, LocalDispatcher dispatcher, Boolean triggerExternalOps, Boolean triggerPriceRules, Boolean skipInventoryChecks, Boolean skipProductChecks) throws CartItemModifyException, ItemNotFoundException {
Method addOrIncreaseItem
has 19 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public int addOrIncreaseItem(String productId, BigDecimal selectedAmount, BigDecimal quantity, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons,
String accommodationMapId, String accommodationSpotId, Timestamp shipBeforeDate, Timestamp shipAfterDate, Map<String, GenericValue> features, Map<String,Object> attributes,
Map<String, String> orderItemAttributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, String itemGroupNumber,
String parentProductId, LocalDispatcher dispatcher) throws CartItemModifyException, ItemNotFoundException {
Method addOrIncreaseItem
has 18 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public int addOrIncreaseItem(String productId, BigDecimal selectedAmount, BigDecimal quantity, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons,
String accommodationMapId, String accommodationSpotId, Timestamp shipBeforeDate, Timestamp shipAfterDate, Map<String, GenericValue> features, Map<String, Object> attributes,
String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, String itemGroupNumber, String parentProductId, LocalDispatcher dispatcher) throws CartItemModifyException, ItemNotFoundException {
Method addItemToEnd
has 18 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public int addItemToEnd(String productId, BigDecimal amount, BigDecimal quantity, BigDecimal unitPrice, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, String accommodationMapId, String accommodationSpotId, HashMap<String, GenericValue> features, HashMap<String, Object> attributes, String prodCatalogId, String itemType, LocalDispatcher dispatcher, Boolean triggerExternalOps, Boolean triggerPriceRules, Boolean skipInventoryChecks, Boolean skipProductChecks) throws CartItemModifyException, ItemNotFoundException {
Method makePurchaseOrderItem
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public ShoppingCartItem makePurchaseOrderItem(Integer cartLocation, String productId, BigDecimal selectedAmount, BigDecimal quantity,
Map<String, GenericValue> additionalProductFeatureAndAppls, Map<String, Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup,
LocalDispatcher dispatcher, ShoppingCart cart, GenericValue supplierProduct, Timestamp shipBeforeDate, Timestamp shipAfterDate, Timestamp cancelBackOrderDate, ShoppingCartItem.ExtraPurchaseOrderInitArgs extraInitArgs)
Method addItemToEnd
has 17 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public int addItemToEnd(String productId, BigDecimal amount, BigDecimal quantity, BigDecimal unitPrice, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, HashMap<String, GenericValue> features, HashMap<String, Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, LocalDispatcher dispatcher, Boolean triggerExternalOps, Boolean triggerPriceRules, Boolean skipInventoryChecks, Boolean skipProductChecks) throws CartItemModifyException, ItemNotFoundException {
Method addOrIncreaseItem
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public int addOrIncreaseItem(String productId, BigDecimal selectedAmount, BigDecimal quantity, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons,
Timestamp shipBeforeDate, Timestamp shipAfterDate, Map<String, GenericValue> features, Map<String, Object> attributes, String prodCatalogId,
ProductConfigWrapper configWrapper, String itemType, String itemGroupNumber, String parentProductId, LocalDispatcher dispatcher) throws CartItemModifyException, ItemNotFoundException {
Method addItemToEnd
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public int addItemToEnd(String productId, BigDecimal amount, BigDecimal quantity, BigDecimal unitPrice, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, String accommodationMapId, String accommodationSpotId, HashMap<String, GenericValue> features, HashMap<String, Object> attributes, String prodCatalogId, String itemType, LocalDispatcher dispatcher, Boolean triggerExternalOps, Boolean triggerPriceRules) throws CartItemModifyException, ItemNotFoundException {
Method addItemToEnd
has 16 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public int addItemToEnd(String productId, BigDecimal amount, BigDecimal quantity, BigDecimal unitPrice, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, HashMap<String, GenericValue> features, HashMap<String, Object> attributes, String prodCatalogId, String itemType, LocalDispatcher dispatcher, Boolean triggerExternalOps, Boolean triggerPriceRules, Boolean skipInventoryChecks, Boolean skipProductChecks) throws CartItemModifyException, ItemNotFoundException {
Method addItemToEnd
has 14 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public int addItemToEnd(String productId, BigDecimal amount, BigDecimal quantity, BigDecimal unitPrice, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, HashMap<String, GenericValue> features, HashMap<String, Object> attributes, String prodCatalogId, String itemType, LocalDispatcher dispatcher, Boolean triggerExternalOps, Boolean triggerPriceRules) throws CartItemModifyException, ItemNotFoundException {
Method addItemToEnd
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public int addItemToEnd(String productId, BigDecimal amount, BigDecimal quantity, BigDecimal unitPrice, HashMap<String, GenericValue> features, HashMap<String, Object> attributes, String prodCatalogId, String itemType, LocalDispatcher dispatcher, Boolean triggerExternalOps, Boolean triggerPriceRules, Boolean skipInventoryChecks, Boolean skipProductChecks) throws CartItemModifyException, ItemNotFoundException {
Method makeItem
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public ShoppingCartItem makeItem(Integer cartLocation, String itemType, String itemDescription, String productCategoryId,
BigDecimal basePrice, BigDecimal selectedAmount, BigDecimal quantity, Map<String, Object> attributes, String prodCatalogId, ShoppingCart.ShoppingCartItemGroup itemGroup,
LocalDispatcher dispatcher, ShoppingCart cart, Boolean triggerExternalOpsBool) throws CartItemModifyException {
Method addItemToEnd
has 12 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public int addItemToEnd(String productId, BigDecimal amount, BigDecimal quantity, BigDecimal unitPrice, HashMap<String, GenericValue> features, HashMap<String, Object> attributes, String prodCatalogId, String itemType, ProductConfigWrapper configWrapper, LocalDispatcher dispatcher, Boolean triggerExternalOps, Boolean triggerPriceRules) throws CartItemModifyException, ItemNotFoundException {
Method addItemToEnd
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public int addItemToEnd(String productId, BigDecimal amount, BigDecimal quantity, BigDecimal unitPrice, HashMap<String, GenericValue> features, HashMap<String, Object> attributes, String prodCatalogId, String itemType, LocalDispatcher dispatcher, Boolean triggerExternalOps, Boolean triggerPriceRules) throws CartItemModifyException, ItemNotFoundException {
Consider simplifying this complex logical expression. Wontfix
Wontfix
if (ALL == mode || (FILLED_ONLY == mode && UtilValidate.isNotEmpty(value)) || (EMPTY_ONLY == mode && UtilValidate.isEmpty(value))
|| (mode != ALL && mode != FILLED_ONLY && mode != EMPTY_ONLY)) {
GenericValue orderItemAttribute = getDelegator().makeValue("OrderItemAttribute");
if (UtilValidate.isNotEmpty(orderId)) {
Method newItem
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public ShoppingCartItem newItem(GenericValue product, Map<String, GenericValue> additionalProductFeatureAndAppls, Map<String, Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, Locale locale, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, GenericValue parentProduct) {
Method newItem
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public ShoppingCartItem newItem(Delegator delegator, String itemTypeId, String description, String categoryId, BigDecimal basePrice, Map<String, Object> attributes, String prodCatalogId, Locale locale, ShoppingCart.ShoppingCartItemGroup itemGroup) {
Method addNonProductItem
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public int addNonProductItem(String itemType, String description, String categoryId, BigDecimal price, BigDecimal quantity,
Map<String, Object> attributes, String prodCatalogId, String itemGroupNumber, LocalDispatcher dispatcher) throws CartItemModifyException {
Method newItem
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public ShoppingCartItem newItem(GenericValue product, Map<String, GenericValue> additionalProductFeatureAndAppls, Map<String, Object> attributes, String prodCatalogId, Locale locale, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup) {
Method addPaymentAmount
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public CartPaymentInfo addPaymentAmount(String id, BigDecimal amount, String refNum, String authCode, boolean isSingleUse, boolean isPresent, boolean replace) {
Avoid deeply nested control flow statements. Open
Open
if (product != null) {
if (!ProductWorker.isShippableToAddress(product, shippingAddress)) {
throw new IllegalArgumentException("The shipping address is not compatible with ProductGeos rules.");
}
}
Method addOrderTerm
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public int addOrderTerm(String termTypeId, String orderItemSeqId,BigDecimal termValue, Long termDays, String textValue, String description) {
Avoid deeply nested control flow statements. Open
Open
while (fsppas.hasNext()) {
// TODO - fix the free shipping promotions!!
}
Method getPaymentInfo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public CartPaymentInfo getPaymentInfo(String id, String refNum, String authCode, BigDecimal amount, boolean update) {
Method addProductPromoUse
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public void addProductPromoUse(String productPromoId, String productPromoCodeId, BigDecimal totalDiscountAmount, BigDecimal quantityLeftInActions, Map<ShoppingCartItem,BigDecimal> usageInfoMap) {
Method positionItemToGroup
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public void positionItemToGroup(ShoppingCartItem item, BigDecimal quantity, int fromIndex, int toIndex, boolean clearEmptyGroups) {
Method positionItemToGroup
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public void positionItemToGroup(int itemIndex, BigDecimal quantity, int fromIndex, int toIndex, boolean clearEmptyGroups) {
Method findCartItem
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public ShoppingCartItem findCartItem(String productId, Map<String, GenericValue> features, Map<String, Object> attributes, String prodCatalogId, BigDecimal selectedAmount) {
Avoid too many return
statements within this method. Open
Open
return 0;
Avoid too many return
statements within this method. Open
Open
return;
Avoid too many return
statements within this method. Open
Open
return -1;
Avoid too many return
statements within this method. Open
Open
return 1;
Avoid too many return
statements within this method. Open
Open
return null;
Avoid too many return
statements within this method. Open
Open
return pmCmp;
Avoid too many return
statements within this method. Open
Open
return newProductId;
Avoid too many return
statements within this method. Open
Open
return 0;
Avoid too many return
statements within this method. Open
Open
return null;
Avoid too many return
statements within this method. Open
Open
return null;
Avoid too many return
statements within this method. Open
Open
return;
Avoid too many return
statements within this method. Open
Open
return pmtCmp;
Avoid too many return
statements within this method. Open
Open
return;
Avoid too many return
statements within this method. Open
Open
return null;
Avoid too many return
statements within this method. Open
Open
return 1;
Avoid too many return
statements within this method. Open
Open
return this.refNum[0].compareTo(that.refNum[0]);
Avoid too many return
statements within this method. Open
Open
return -1;
Avoid too many return
statements within this method. Open
Open
return -1;