ilscipio/scipio-erp

View on GitHub
applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java

Summary

Maintainability
F
1 wk
Test Coverage

ShoppingCartItem has 184 methods (exceeds 20 allowed). Consider refactoring.
Open

@SuppressWarnings("serial")
public class ShoppingCartItem implements java.io.Serializable {

    private static final Debug.OfbizLogger module = Debug.getOfbizLogger(java.lang.invoke.MethodHandles.lookup().lookupClass());
    public static final String resource = "OrderUiLabels";

    Method makeItem has 26 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static 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 makeItemImpl has 26 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          protected static ShoppingCartItem makeItemImpl(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 makeItem has 26 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static ShoppingCartItem makeItem(Integer cartLocation, String productId, 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, ShoppingCart cart, Boolean triggerExternalOpsBool, Boolean triggerPriceRulesBool, String parentProductId, Boolean skipInventoryChecks, Boolean skipProductChecks,
                    ExtraInitArgs extraInitArgs)

          Method makeItem has 25 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static 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 makeItem has 25 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public static ShoppingCartItem makeItem(Integer cartLocation, String productId, 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, ShoppingCart cart, Boolean triggerExternalOpsBool, Boolean triggerPriceRulesBool, String parentProductId, Boolean skipInventoryChecks, Boolean skipProductChecks)

              Method makeItem has 23 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public static ShoppingCartItem makeItem(Integer cartLocation, GenericValue product, BigDecimal selectedAmount,
                          BigDecimal quantity, BigDecimal unitPrice, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons,
                          Timestamp shipBeforeDate, Timestamp shipAfterDate, Map<String, GenericValue> additionalProductFeatureAndAppls, Map<String, Object> attributes,
                          String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, LocalDispatcher dispatcher,
                          ShoppingCart cart, Boolean triggerExternalOpsBool, Boolean triggerPriceRulesBool, GenericValue parentProduct, Boolean skipInventoryChecks, Boolean skipProductChecks) throws CartItemModifyException {

                Method makeItem has 23 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public static ShoppingCartItem makeItem(Integer cartLocation, String productId, BigDecimal selectedAmount, BigDecimal quantity, BigDecimal unitPrice,
                            Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, Timestamp shipBeforeDate, Timestamp shipAfterDate,
                            Map<String, GenericValue> additionalProductFeatureAndAppls, Map<String, Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper,
                            String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, LocalDispatcher dispatcher, ShoppingCart cart, Boolean triggerExternalOpsBool, Boolean triggerPriceRulesBool, String parentProductId, Boolean skipInventoryChecks, Boolean skipProductChecks)

                  Method makePurchaseOrderItemImpl has 17 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public static ShoppingCartItem makePurchaseOrderItemImpl(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, ExtraPurchaseOrderInitArgs extraInitArgs)

                    Method makePurchaseOrderItem has 17 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public static 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, ExtraPurchaseOrderInitArgs extraInitArgs)

                      Method makePurchaseOrderItem has 16 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public static 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)

                        Method equals has 15 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            public boolean equals(String productId, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, String accommodationMapId, String accommodationSpotId,
                                    Map<String, GenericValue> additionalProductFeatureAndAppls, Map<String, Object> attributes, Map<String, String> orderItemAttributes, String prodCatalogId, BigDecimal selectedAmount,
                                    ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, boolean isPromo) {

                          Method equals has 14 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              public boolean equals(String productId, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, String accommodationMapId, String accommodationSpotId,
                                      Map<String, GenericValue> additionalProductFeatureAndAppls, Map<String, Object> attributes, String prodCatalogId, BigDecimal selectedAmount,
                                      ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, boolean isPromo) {

                            Method makeItemImpl has 13 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                public static ShoppingCartItem makeItemImpl(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 makeItem has 13 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  public static 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 equals has 11 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    public boolean equals(String productId, Timestamp reservStart, BigDecimal reservLength, BigDecimal reservPersons, Map<String, GenericValue> additionalProductFeatureAndAppls, Map<String, Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, BigDecimal selectedAmount) {

                                  Consider simplifying this complex logical expression.
                                  Wontfix

                                          if ((this.orderItemAttributes == null && UtilValidate.isNotEmpty(orderItemAttributes)) || (UtilValidate.isNotEmpty(this.orderItemAttributes) && orderItemAttributes == null) ||
                                                  (this.orderItemAttributes != null && orderItemAttributes != null && (this.orderItemAttributes.size() != orderItemAttributes.size() || !(this.orderItemAttributes.equals(orderItemAttributes))))) {
                                              // order item attribute unique
                                              return false;
                                          }

                                    Consider simplifying this complex logical expression.
                                    Wontfix

                                            if ((this.attributes == null && UtilValidate.isNotEmpty(attributes)) || (UtilValidate.isNotEmpty(this.attributes) && attributes == null) ||
                                                    (this.attributes != null && attributes != null && (this.attributes.size() != attributes.size() || !(this.attributes.equals(attributes))))) {
                                                return false;
                                            }

                                      Consider simplifying this complex logical expression.
                                      Wontfix

                                              if ((this.additionalProductFeatureAndAppls == null && UtilValidate.isNotEmpty(additionalProductFeatureAndAppls)) ||
                                                      (UtilValidate.isNotEmpty(this.additionalProductFeatureAndAppls) && additionalProductFeatureAndAppls == null) ||
                                                      (this.additionalProductFeatureAndAppls != null && additionalProductFeatureAndAppls != null &&
                                                      (this.additionalProductFeatureAndAppls.size() != additionalProductFeatureAndAppls.size() ||
                                                      !(this.additionalProductFeatureAndAppls.equals(additionalProductFeatureAndAppls))))) {

                                        Method equals has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                            public boolean equals(String productId, Map<String, GenericValue> additionalProductFeatureAndAppls, Map<String, Object> attributes, String prodCatalogId, BigDecimal selectedAmount, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, boolean isPromo) {

                                          Method equals has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                              public boolean equals(String productId, Map<String, GenericValue> additionalProductFeatureAndAppls, Map<String, Object> attributes, String prodCatalogId, ProductConfigWrapper configWrapper, String itemType, ShoppingCart.ShoppingCartItemGroup itemGroup, BigDecimal selectedAmount) {

                                            Method setQuantity has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                                protected void setQuantity(BigDecimal quantity, LocalDispatcher dispatcher, ShoppingCart cart, boolean triggerExternalOps, boolean resetShipGroup,
                                                        boolean updateProductPrice, boolean skipInventoryChecks) throws CartItemModifyException {

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                                  if (UtilValidate.isNotEmpty(surveyResponseId)) {
                                                                                      priceContext.put("surveyResponseId", surveyResponseId);
                                                                                      break;
                                                                                  }

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                        if (adjustment != null) {
                                                                            item.removeAdjustment(adjustment);
                                                                            GenericValue newAdjustment = GenericValue.create(adjustment);
                                                                            BigDecimal adjAmount = newAdjustment.getBigDecimal("amount");
                                                
                                                

                                                  Method setQuantity has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                  Open

                                                      public void setQuantity(BigDecimal quantity, LocalDispatcher dispatcher, ShoppingCart cart, boolean triggerExternalOps, boolean resetShipGroup, boolean updateProductPrice) throws CartItemModifyException {

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                            if (adjAmount != null && adjAmount.compareTo(BigDecimal.ZERO) != 0) {
                                                                                newAdjustment.set("amount", adjAmount.divide(baseQuantity, generalRounding));
                                                                            }

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                              if (amount.compareTo(BigDecimal.ZERO) <= 0 && defaultAmount.compareTo(BigDecimal.ZERO) > 0) {
                                                                                  amount = defaultAmount;
                                                                              }

                                                        Method checkAvailability has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                        Open

                                                            public static String checkAvailability(String productId, BigDecimal quantity, Timestamp reservStart, BigDecimal reservLength, ShoppingCart cart) {

                                                          Method findProduct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                          Open

                                                              public static GenericValue findProduct(Delegator delegator, boolean skipProductChecks, String prodCatalogId, String productId, Locale locale) throws CartItemModifyException, ItemNotFoundException {

                                                            Method equals has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                            Open

                                                                public boolean equals(String productId, Map<String, GenericValue> additionalProductFeatureAndAppls, Map<String, Object> attributes, String prodCatalogId, BigDecimal selectedAmount) {

                                                              Method setQuantity has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                              Open

                                                                  public void setQuantity(BigDecimal quantity, LocalDispatcher dispatcher, ShoppingCart cart, boolean triggerExternalOps, boolean resetShipGroup) throws CartItemModifyException {

                                                                Avoid too many return statements within this method.
                                                                Open

                                                                            return false;

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                              return false;

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                                return false;

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                                  return false;

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                    return false;

                                                                          Avoid too many return statements within this method.
                                                                          Open

                                                                                      return false;

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                        return msg;

                                                                              Avoid too many return statements within this method.
                                                                              Open

                                                                                          return false;

                                                                                Avoid too many return statements within this method.
                                                                                Open

                                                                                            return false;

                                                                                  Avoid too many return statements within this method.
                                                                                  Open

                                                                                              return false;

                                                                                    Avoid too many return statements within this method.
                                                                                    Open

                                                                                                    return msg;

                                                                                      Avoid too many return statements within this method.
                                                                                      Open

                                                                                                  return msg;

                                                                                        Avoid too many return statements within this method.
                                                                                        Open

                                                                                                    return false;

                                                                                          Avoid too many return statements within this method.
                                                                                          Open

                                                                                                  return msg;

                                                                                            Avoid too many return statements within this method.
                                                                                            Open

                                                                                                        return false;

                                                                                              Avoid too many return statements within this method.
                                                                                              Open

                                                                                                          return false;

                                                                                                Avoid too many return statements within this method.
                                                                                                Open

                                                                                                            return false;

                                                                                                  Avoid too many return statements within this method.
                                                                                                  Open

                                                                                                              return false;

                                                                                                    Avoid too many return statements within this method.
                                                                                                    Open

                                                                                                                return false;

                                                                                                      Avoid too many return statements within this method.
                                                                                                      Open

                                                                                                              return true;

                                                                                                        Avoid too many return statements within this method.
                                                                                                        Open

                                                                                                                    return false;

                                                                                                          There are no issues that match your filters.

                                                                                                          Category
                                                                                                          Status