You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "danwatford (via GitHub)" <gi...@apache.org> on 2023/03/14 15:56:59 UTC

[GitHub] [ofbiz-framework] danwatford commented on a diff in pull request #517: Codenarc integration

danwatford commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1135741048


##########
applications/product/groovyScripts/facility/facility/CountFacilityInventoryByProduct.groovy:
##########
@@ -55,166 +57,167 @@ rows = [] as ArrayList
 if (action) {
     // ------------------------------
     prodView = new DynamicViewEntity()
-    atpDiffComplexAlias = new ComplexAlias("-")
+    atpDiffComplexAlias = new ComplexAlias('-')
 
-    conditionMap = [facilityId : facilityId]
+    conditionMap = [facilityId: facilityId]
 
     if (offsetQOHQty) {
         try {
             offsetQOH = Integer.parseInt(offsetQOHQty)
             hasOffsetQOH = true
-            searchParameterString = searchParameterString + "&offsetQOHQty=" + offsetQOH
+            searchParameterString = searchParameterString + '&offsetQOHQty=' + offsetQOH
         } catch (NumberFormatException nfe) {
-            logError(nfe, "Caught an exception : " + nfe.toString())
-            request.setAttribute("_ERROR_MESSAGE", "An entered value seems non-numeric")
+            logError(nfe, 'Caught an exception : ' + nfe)
+            request.setAttribute('_ERROR_MESSAGE', 'An entered value seems non-numeric')
         }
     }
     if (offsetATPQty) {
         try {
             offsetATP = Integer.parseInt(offsetATPQty)
             hasOffsetATP = true
-            searchParameterString = searchParameterString + "&offsetATPQty=" + offsetATP
+            searchParameterString = searchParameterString + '&offsetATPQty=' + offsetATP
         } catch (NumberFormatException nfe) {
-            logError(nfe, "Caught an exception : " + nfe.toString())
-            request.setAttribute("_ERROR_MESSAGE", "An entered value seems non-numeric")
+            logError(nfe, 'Caught an exception : ' + nfe)
+            request.setAttribute('_ERROR_MESSAGE', 'An entered value seems non-numeric')
         }
     }
 
-    prodView.addMemberEntity("PRFA", "ProductFacility")
-    prodView.addAlias("PRFA", "productId", null, null, null, Boolean.TRUE, null)
-    prodView.addAlias("PRFA", "minimumStock", null, null, null, Boolean.TRUE, null)
-    prodView.addAlias("PRFA", "reorderQuantity", null, null, null, Boolean.TRUE, null)
-    prodView.addAlias("PRFA", "daysToShip", null, null, null, Boolean.TRUE, null)
-    prodView.addAlias("PRFA", "facilityId", null, null, null, Boolean.TRUE, null)
-
-    prodView.addMemberEntity("PROD", "Product")
-    prodView.addViewLink("PROD", "PRFA", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"))
-    prodView.addAlias("PROD", "internalName", null, null, null, Boolean.TRUE, null)
-    prodView.addAlias("PROD", "isVirtual", null, null, null, Boolean.TRUE, null)
-    prodView.addAlias("PROD", "salesDiscontinuationDate", null, null, null, Boolean.TRUE, null)
+/* codenarc-disable */

Review Comment:
   If we need to disable codenarc we should be explicit about which rule(s) is being disabled. It will help future authors understand what they could improve.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org