applications/product/src/org/ofbiz/product/product/ProductServices.java
ProductServices
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class ProductServices {
private static final Debug.OfbizLogger module = Debug.getOfbizLogger(java.lang.invoke.MethodHandles.lookup().lookupClass());
public static final String resource = "ProductUiLabels";
public static final String resourceError = "ProductErrorUiLabels";
Method uploadImage
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static Map<String, Object> uploadImage(Map<String, ?> context, LocalDispatcher dispatcher, Delegator delegator, String id,
String contentTypeId, String location, ByteBuffer imageData, Locale locale, Map<String, String> entityInfo) {
Method addImageResource
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static Map<String,Object> addImageResource(LocalDispatcher dispatcher, Delegator delegator, Map<String, ? extends Object> context,
String imageUrl, String id, String contentTypeId, Map<String, String> entityInfo) {
Avoid deeply nested control flow statements. Open
Open
if (availableToPromiseTotal != null && availableToPromiseTotal.compareTo(BigDecimal.ZERO) > 0) {
// refresh the product so we can update it
GenericValue productToUpdate = null;
try {
productToUpdate = EntityQuery.use(delegator).from("Product").where(product.getPrimaryKey()).queryOne();
Avoid deeply nested control flow statements. Open
Open
if (ServiceUtil.isError(serviceResult)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(serviceResult));
}
Avoid deeply nested control flow statements. Open
Open
if (context.containsKey("imageProfile")) { // SCIPIO
Map<String, Object> contentCtx = new HashMap<>();
contentCtx.put("contentId", contentId);
contentCtx.put("mediaProfile", context.get("imageProfile"));
contentCtx.put("userLogin", userLogin);
Avoid deeply nested control flow statements. Open
Open
if (ServiceUtil.isError(invRes)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(invRes));
}
Avoid deeply nested control flow statements. Open
Open
if (ServiceUtil.isError(serviceResult)) {
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(serviceResult));
}
Avoid deeply nested control flow statements. Open
Open
if (dataResource != null) {
dataResourceCtx.put("dataResourceId", dataResource.getString("dataResourceId"));
try {
Map<String, Object> serviceResult = dispatcher.runSync("updateDataResource", dataResourceCtx);
if (ServiceUtil.isError(serviceResult)) {
Method makeGroup
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static Map<String, Object> makeGroup(Delegator delegator, Map<String, List<String>> featureList, List<String> items, List<String> order, int index)
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(e.getMessage());
Avoid too many return
statements within this method. Open
Open
return result;
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(e.getMessage());
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(e.getMessage());
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(e.getMessage());
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(e.getMessage());
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(e.getMessage());
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(e.getMessage());
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(e.getMessage());
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(e.getMessage());
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(e.getMessage());
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(e.getMessage());
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(e.getMessage());
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(e.getMessage());
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(e.getMessage());
Avoid too many return
statements within this method. Open
Open
return addImageResource(dispatcher, delegator, context, imageUrl, id, contentTypeId, entityInfo);
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(e.getMessage());
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(e.getMessage());
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ProductFeatureTreeCannotCallIsStoreInventoryRequired", locale));
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(dataResourceResult));
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(e.getMessage());
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(e.getMessage());
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
"productservices.empty_list_of_selectable_features_found", locale));
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(e.getMessage());
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(ServiceUtil.getErrorMessage(dataResourceResult));
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(UtilProperties.getMessage(resource,
"ProductImageViewUnableWriteBinaryData", UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
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(dataResourceResult));
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(e.getMessage());
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(e.getMessage());
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(ServiceUtil.getErrorMessage(serviceResult));
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(e.getMessage());
Avoid too many return
statements within this method. Open
Open
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(contentResult));