You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by GitBox <gi...@apache.org> on 2022/07/01 14:09:33 UTC
[GitHub] [ofbiz-framework] gilPts opened a new pull request, #517: Codenarc integration
gilPts opened a new pull request, #517:
URL: https://github.com/apache/ofbiz-framework/pull/517
Implemented: add codenarc and fix first basic rules.
(OFBIZ-11167)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1211733265
SonarCloud Quality Gate failed. [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![9.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png '9.4%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [9.4% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] danwatford commented on a diff in pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1157502903
##########
framework/webtools/groovyScripts/entity/XmlDsDump.groovy:
##########
@@ -17,151 +17,158 @@
* under the License.
*/
-import java.util.*
-import java.io.*
-import org.apache.ofbiz.base.util.*
-import org.apache.ofbiz.entity.model.*
-import org.apache.ofbiz.entity.util.*
-import org.apache.ofbiz.entity.transaction.*
-import org.apache.ofbiz.entity.condition.*
+import org.apache.ofbiz.base.util.Debug
+import org.apache.ofbiz.base.util.UtilFormatOut
+import org.apache.ofbiz.entity.condition.EntityComparisonOperator
+import org.apache.ofbiz.entity.condition.EntityCondition
+import org.apache.ofbiz.entity.condition.EntityJoinOperator
+import org.apache.ofbiz.entity.model.ModelViewEntity
+import org.apache.ofbiz.entity.transaction.TransactionUtil
+import org.apache.ofbiz.entity.util.EntityFindOptions
outpath = parameters.outpath
filename = parameters.filename
maxRecStr = parameters.maxrecords
entitySyncId = parameters.entitySyncId
passedEntityNames = null
-if (parameters.entityName) passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet
+if (parameters.entityName) {
+ passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet
+}
// get the max records per file setting and convert to a int
-maxRecordsPerFile = 0
-if (maxRecStr) {
- try {
- maxRecordsPerFile = Integer.parseInt(maxRecStr)
- }
- catch (Exception e) {
- }
-}
+int maxRecordsPerFile = maxRecStr ? (maxRecStr as int) : 0
Review Comment:
I don't think this should have been resolved - as far as I can tell the potential error still exists on line 39, but would not have occurred in the code used prior to this PR.
--
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
[GitHub] [ofbiz-framework] danwatford commented on pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1498969006
Hi @gilPts ,
I just tried a `./gradlew build` with your branch and received a build failure:
```
> Task :codenarcGroovyScripts FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':codenarcGroovyScripts'.
> CodeNarc rule violations were found. See the report at: file:///C:/dev/floss/ofbiz/ofbiz-framework/build/reports/codenarc/groovyScripts.html
```
In the CodeNarc report I see there are 448 Priority 2 issues and 4396 Priority 3 issues listed.
It seems unlikely that we will be able to address all of these quickly.
Do you know if CodeNarc can be configured with a threshold of permitted Priority 2 and Priority 3 issues that would allow the build to proceed? This is approach we use with Checkstyle.
If so, then over time we could gradually reduce the permitted number of issues until we hopefully reach zero, improving code 'hygiene' over time, but also getting CodeNarc integration in place as soon as possible.
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147861703
##########
applications/party/groovyScripts/party/EditPaymentMethod.groovy:
##########
@@ -38,24 +38,36 @@ context.postalAddressInfos = ContactMechWorker.getPartyPostalAddresses(request,
tryEntity = paymentResults.tryEntity
creditCardData = paymentResults.creditCard
-if (!tryEntity) creditCardData = parameters
-context.creditCardData = creditCardData ?:[:]
+if (!tryEntity) {
Review Comment:
Hopefully done one day, not a big deal
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1483072556
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [3 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147859199
##########
applications/product/groovyScripts/product/promo/ProductPromoActionServices.groovy:
##########
@@ -173,18 +183,19 @@ def productGWP() {
Iterator<String> optionProductIdTempIter = optionProductIds.iterator()
productId = optionProductIdTempIter.next()
optionProductIdTempIter.remove()
- product = from("Product").where("productId", productId).cache().queryOne()
+ product = from('Product').where('productId', productId).cache().queryOne()
}
if (!product) {
// no product found to add as GWP, just return
- return
+ return [*:result, actionResultInfo: parameters.actionResultInfo]
Review Comment:
OK, thanks for the info
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147768342
##########
applications/accounting/groovyScripts/reports/CostCenters.groovy:
##########
@@ -26,50 +25,49 @@ import org.apache.ofbiz.entity.condition.EntityOperator
if (!fromDate) {
return
}
-if (!thruDate) {
- thruDate = UtilDateTime.nowTimestamp()
-}
-if (!parameters.glFiscalTypeId) {
- parameters.glFiscalTypeId = "ACTUAL"
-}
+thruDate = thruDate ?: UtilDateTime.nowTimestamp()
+parameters.glFiscalTypeId = parameters.glFiscalTypeId ?: 'ACTUAL'
// POSTED
// Posted transactions totals and grand totals
postedTotalDebit = BigDecimal.ZERO
postedTotalCredit = BigDecimal.ZERO
andExprs = []
-andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds))
-andExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y"))
-andExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, parameters.glFiscalTypeId))
-andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
-andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
+andExprs.add(EntityCondition.makeCondition('organizationPartyId', EntityOperator.IN, partyIds))
+andExprs.add(EntityCondition.makeCondition('isPosted', EntityOperator.EQUALS, 'Y'))
+andExprs.add(EntityCondition.makeCondition('glFiscalTypeId', EntityOperator.EQUALS, parameters.glFiscalTypeId))
+andExprs.add(EntityCondition.makeCondition('transactionDate', EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
+andExprs.add(EntityCondition.makeCondition('transactionDate', EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
andCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND)
-List postedTransactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(andCond).orderBy("glAccountId").queryList()
+List postedTransactionTotals = select('glAccountId', 'accountName', 'accountCode', 'debitCreditFlag', 'amount')
+ .from('AcctgTransEntrySums').where(andCond).orderBy('glAccountId').queryList()
if (postedTransactionTotals) {
- glAccountCategories = from("GlAccountCategory").where("glAccountCategoryTypeId", "COST_CENTER").orderBy("glAccountCategoryId").queryList()
+ glAccountCategories = from('GlAccountCategory').where('glAccountCategoryTypeId', 'COST_CENTER').orderBy('glAccountCategoryId').queryList()
context.glAccountCategories = glAccountCategories
Map postedTransactionTotalsMap = [:]
postedTransactionTotals.each { postedTransactionTotal ->
Map accountMap = (Map)postedTransactionTotalsMap.get(postedTransactionTotal.glAccountId)
if (!accountMap) {
accountMap = UtilMisc.makeMapWritable(postedTransactionTotal)
- accountMap.put("D", BigDecimal.ZERO)
- accountMap.put("C", BigDecimal.ZERO)
+ accountMap.put('D', BigDecimal.ZERO)
+ accountMap.put('C', BigDecimal.ZERO)
}
UtilMisc.addToBigDecimalInMap(accountMap, postedTransactionTotal.debitCreditFlag, postedTransactionTotal.amount)
postedTransactionTotalsMap.put(postedTransactionTotal.glAccountId, accountMap)
- BigDecimal debitAmount = (BigDecimal)accountMap.get("D")
- BigDecimal creditAmount = (BigDecimal)accountMap.get("C")
+ BigDecimal debitAmount = (BigDecimal)accountMap.get('D')
+ BigDecimal creditAmount = (BigDecimal)accountMap.get('C')
BigDecimal balance = debitAmount.subtract(creditAmount)
- accountMap.put("balance", balance)
+ accountMap.put('balance', balance)
glAccountCategories.each { glAccountCategory ->
- glAccountCategoryMember = from("GlAccountCategoryMember").where("glAccountCategoryId", glAccountCategory.glAccountCategoryId, "glAccountId", postedTransactionTotal.glAccountId).orderBy("glAccountCategoryId").filterByDate().queryFirst()
+ glAccountCategoryMember = from('GlAccountCategoryMember')
+ .where('glAccountCategoryId', glAccountCategory.glAccountCategoryId, 'glAccountId', postedTransactionTotal.glAccountId)
+ .orderBy('glAccountCategoryId').filterByDate().queryFirst()
if (glAccountCategoryMember) {
BigDecimal glAccountCategorySharePercentage = glAccountCategoryMember.amountPercentage
if (glAccountCategorySharePercentage && glAccountCategorySharePercentage != BigDecimal.ZERO ) {
Review Comment:
If that is ok with you we can resolve the conversation ?
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147821807
##########
applications/party/groovyScripts/party/EditPaymentMethod.groovy:
##########
@@ -38,24 +38,36 @@ context.postalAddressInfos = ContactMechWorker.getPartyPostalAddresses(request,
tryEntity = paymentResults.tryEntity
creditCardData = paymentResults.creditCard
-if (!tryEntity) creditCardData = parameters
-context.creditCardData = creditCardData ?:[:]
+if (!tryEntity) {
Review Comment:
I agree, but in a separate effort :)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1382138297
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1380720781
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1497571869
@danwatford , it's possible conflicts related to change for https://issues.apache.org/jira/browse/OFBIZ-12793 "Cannot add a new geo point to a facility"
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147866821
##########
applications/product/groovyScripts/facility/shipment/PrintPickSheets.groovy:
##########
@@ -60,16 +59,18 @@ if (toPrintOrders) {
orderMap.orderId = orderId
orderMap.orderDate = orderHeader.orderDate
billingOrderContactMechs = []
- billingOrderContactMechs = from("OrderContactMech").where("orderId", orderId, "contactMechPurposeTypeId", "BILLING_LOCATION").queryList()
+ billingOrderContactMechs = from('OrderContactMech')
+ .where('orderId', orderId, 'contactMechPurposeTypeId', 'BILLING_LOCATION').queryList()
if (billingOrderContactMechs.size() > 0) {
billingContactMechId = EntityUtil.getFirst(billingOrderContactMechs).contactMechId
- billingAddress = from("PostalAddress").where("contactMechId", billingContactMechId).queryOne()
+ billingAddress = from('PostalAddress').where('contactMechId', billingContactMechId).queryOne()
}
- shippingContactMechId = from("OrderContactMech").where("orderId", orderId, "contactMechPurposeTypeId", "SHIPPING_LOCATION").queryFirst().contactMechId
- shippingAddress = from("PostalAddress").where("contactMechId", shippingContactMechId).queryOne()
+ shippingContactMechId = from('OrderContactMech')
+ .where('orderId', orderId, 'contactMechPurposeTypeId', 'SHIPPING_LOCATION').queryFirst().contactMechId
+ shippingAddress = from('PostalAddress').where('contactMechId', shippingContactMechId).queryOne()
orderItemShipGroups.each { orderItemShipGroup ->
if (orderItemShipGroup.orderId == orderId) {
- orderMap.shipmentMethodType = EntityUtil.getFirst(orderItemShipGroup.getRelated("ShipmentMethodType", null, null, false)).description
+ orderMap.shipmentMethodType = orderItemShipGroup.getRelated('ShipmentMethodType', null, null, false)[0]?.description
Review Comment:
OK
##########
applications/product/groovyScripts/product/cost/CostServices.groovy:
##########
@@ -495,15 +497,14 @@ def getProductAverageCost() {
/**
* Formula that creates a cost component equal to a percentage of total product cost
- * @return
*/
-def productCostPercentageFormula() {
+Map productCostPercentageFormula() {
Map result = success()
GenericValue productCostComponentCalc = parameters.productCostComponentCalc
GenericValue costComponentCalc = parameters.costComponentCalc
- Map inputMap = [productId: productCostComponentCalc.productId, currencyUomId: parameters.currencyUomId, costComponentTypePrefix: parameters.costComponentTypePrefix]
- Map serviceResult = run service: "getProductCost", with: inputMap
- BigDecimal productCost = serviceResult.productCost
+ Map inputMap = [productId: productCostComponentCalc.productId, currencyUomId: parameters.currencyUomId,
+ costComponentTypePrefix: parameters.costComponentTypePrefix]
+ run service: 'getProductCost', with: inputMap
// set field="productCostAdjustment" value="${parameters.baseCost * costComponentCalc.fixedCost}" type="BigDecimal"/
Review Comment:
OK
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147826282
##########
applications/product/groovyScripts/product/promo/ProductPromoActionServices.groovy:
##########
@@ -161,9 +169,11 @@ def productGWP() {
}
optionProductIds.remove(alternateGwpProductId)
productId = alternateGwpProductId
- product = from("Product").where("productId", productId).cache().queryOne()
+ product = from('Product').where('productId', productId).cache().queryOne()
} else {
- logWarning(UtilProperties.getMessage(resource_error, "OrderAnAlternateGwpProductIdWasInPlaceButWasEitherNotValidOrIsNoLongerInStockForId", UtilMisc.toMap("alternateGwpProductId", alternateGwpProductId), cart.getLocale()))
+ logWarning(UtilProperties.getMessage(resource_error,
+ 'OrderAnAlternateGwpProductIdWasInPlaceButWasEitherNotValidOrIsNoLongerInStockForId',
+ [alternateGwpProductId: alternateGwpProductId], cart.getLocale()))
Review Comment:
There is no need of quotes in map key, see https://groovy-lang.org/syntax.html#_maps
The only case is when the key has some specifics :
> You can also pass quoted strings as well as keys: ["name": "Guillaume"]. This is mandatory if your key string isn’t a valid identifier, for example if you wanted to create a string key containing a dash like in: ["street-name": "Main street"].
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147861320
##########
applications/product/groovyScripts/product/promo/ProductPromoActionServices.groovy:
##########
@@ -161,9 +169,11 @@ def productGWP() {
}
optionProductIds.remove(alternateGwpProductId)
productId = alternateGwpProductId
- product = from("Product").where("productId", productId).cache().queryOne()
+ product = from('Product').where('productId', productId).cache().queryOne()
} else {
- logWarning(UtilProperties.getMessage(resource_error, "OrderAnAlternateGwpProductIdWasInPlaceButWasEitherNotValidOrIsNoLongerInStockForId", UtilMisc.toMap("alternateGwpProductId", alternateGwpProductId), cart.getLocale()))
+ logWarning(UtilProperties.getMessage(resource_error,
+ 'OrderAnAlternateGwpProductIdWasInPlaceButWasEitherNotValidOrIsNoLongerInStockForId',
+ [alternateGwpProductId: alternateGwpProductId], cart.getLocale()))
Review Comment:
I missed that it was already a String, thanks
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1398478367
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1369790625
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] gilPts commented on pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1499000941
I did not found yet a way to exclude plugins, if someone has a guess, it could be nice :)
I'll check to have threshold configuration for plugins.
--
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
[GitHub] [ofbiz-framework] mleila37 commented on a diff in pull request #517: Codenarc integration
Posted by "mleila37 (via GitHub)" <gi...@apache.org>.
mleila37 commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1123321061
##########
applications/order/groovyScripts/entry/AdditionalPartyListing.groovy:
##########
@@ -26,20 +26,20 @@ roleData = [:]
partyData = [:]
additionalPartyRole.each { roleTypeId, partyList ->
- roleData[roleTypeId] = from("RoleType").where("roleTypeId", roleTypeId).queryOne()
+ roleData[roleTypeId] = from('RoleType').where('roleTypeId', roleTypeId).queryOne()
partyList.each { partyId ->
partyMap = [:]
partyMap.partyId = partyId
- party = from("Party").where("partyId", partyId).cache(true).queryOne()
- if ("PERSON".equals(party.partyTypeId)) {
- party = party.getRelatedOne("Person", true)
- partyMap.type = "person"
+ party = from('Party').where('partyId', partyId).cache(true).queryOne()
+ if (party.partyTypeId == 'PERSON') {
Review Comment:
Not related to codenarc application but there is a potential NPE to check
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1149416532
##########
applications/product/groovyScripts/facility/inventory/InventoryItemTotals.groovy:
##########
@@ -31,30 +32,30 @@ retailPriceGrandTotal = 0.0
totalCostPriceGrandTotal = 0.0
totalRetailPriceGrandTotal = 0.0
boolean beganTransaction = false
-searchParameterString = "action=Y&facilityId=" + facilityId
+searchParameterString = 'action=Y&facilityId=' + facilityId
if (action) {
- conditions = [EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "INV_DELIVERED")]
- conditions.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, null))
+ conditions = [EntityCondition.makeCondition('statusId', EntityOperator.NOT_EQUAL, 'INV_DELIVERED')]
+ conditions.add(EntityCondition.makeCondition('statusId', EntityOperator.EQUALS, null))
conditionList = EntityCondition.makeCondition(conditions, EntityOperator.OR)
try {
beganTransaction = TransactionUtil.begin()
- invItemListItr = from("InventoryItem").where(conditionList).orderBy("productId").queryIterator()
+ invItemListItr = from('InventoryItem').where(conditionList).orderBy('productId').queryIterator()
while ((inventoryItem = invItemListItr.next()) != null) {
productId = inventoryItem.productId
- product = from("Product").where("productId", productId).queryOne()
- productFacility = from("ProductFacility").where("productId", productId, "facilityId", facilityId).queryOne()
+ product = from('Product').where('productId', productId).queryOne()
+ productFacility = from('ProductFacility').where('productId', productId, 'facilityId', facilityId).queryOne()
if (productFacility) {
- quantityOnHandTotal = inventoryItem.getDouble("quantityOnHandTotal")
- availableToPromiseTotal = inventoryItem.getDouble("availableToPromiseTotal")
- costPrice = inventoryItem.getDouble("unitCost")
+ quantityOnHandTotal = inventoryItem.getDouble('quantityOnHandTotal')
+ availableToPromiseTotal = inventoryItem.getDouble('availableToPromiseTotal')
+ costPrice = inventoryItem.getDouble('unitCost')
retailPrice = 0.0
totalCostPrice = 0.0
totalRetailPrice = 0.0
- productPrices = product.getRelated("ProductPrice", null, null, false)
+ productPrices = product.getRelated('ProductPrice', null, null, false)
if (productPrices) {
productPrices.each { productPrice ->
- if (("DEFAULT_PRICE").equals(productPrice.productPriceTypeId)) {
- retailPrice = productPrice.getDouble("price")
+ if (productPrice.productPriceTypeId == ("DEFAULT_PRICE")) {
Review Comment:
Done
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by sonarcloud.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1406657687
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1088104573
##########
applications/accounting/groovyScripts/admin/ListInvoiceItemTypesGlAccount.groovy:
##########
@@ -30,25 +30,25 @@ invoiceItemTypes = from('InvoiceItemType').where(exprBldr.LIKE(invoiceItemTypeId
context.invoiceItemTypes = invoiceItemTypes.collect { invoiceItemType ->
defaultAccount = true
glAccount = null
- invoiceItemTypeOrgs = invoiceItemType.getRelated("InvoiceItemTypeGlAccount", [organizationPartyId : organizationPartyId], null, false)
+ invoiceItemTypeOrgs = invoiceItemType.getRelated('InvoiceItemTypeGlAccount', [organizationPartyId: organizationPartyId], null, false)
overrideGlAccountId = null
if (invoiceItemTypeOrgs) {
invoiceItemTypeOrg = invoiceItemTypeOrgs[0]
overrideGlAccountId = invoiceItemTypeOrg.glAccountId
- glAccounts = invoiceItemTypeOrg.getRelated("GlAccount", null, null, false)
+ glAccounts = invoiceItemTypeOrg.getRelated('GlAccount', null, null, false)
if (glAccounts) {
glAccount = glAccounts[0]
defaultAccount = false
}
} else {
- glAccount = invoiceItemType.getRelatedOne("DefaultGlAccount", false)
+ glAccount = invoiceItemType.getRelatedOne('DefaultGlAccount', false)
}
- return [invoiceItemTypeId : invoiceItemType.invoiceItemTypeId,
- description : invoiceItemType.description,
- defaultGlAccountId : invoiceItemType.defaultGlAccountId,
- overrideGlAccountId : overrideGlAccountId,
- defaultAccount : defaultAccount,
- activeGlDescription : glAccount?.accountName]
+ return [invoiceItemTypeId: invoiceItemType.invoiceItemTypeId,
+ description: invoiceItemType.description,
+ defaultGlAccountId: invoiceItemType.defaultGlAccountId,
+ overrideGlAccountId: overrideGlAccountId,
+ defaultAccount: defaultAccount,
+ activeGlDescriptio: glAccount?.accountName]
Review Comment:
Sounds like it indeed, thanks Daniel!
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1172394427
SonarCloud Quality Gate failed. [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![9.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png '9.4%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [9.4% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1213187555
SonarCloud Quality Gate failed. [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![9.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png '9.4%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [9.4% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147549576
##########
applications/product/groovyScripts/product/promo/ProductPromoActionServices.groovy:
##########
@@ -173,18 +183,19 @@ def productGWP() {
Iterator<String> optionProductIdTempIter = optionProductIds.iterator()
productId = optionProductIdTempIter.next()
optionProductIdTempIter.remove()
- product = from("Product").where("productId", productId).cache().queryOne()
+ product = from('Product').where('productId', productId).cache().queryOne()
}
if (!product) {
// no product found to add as GWP, just return
- return
+ return [*:result, actionResultInfo: parameters.actionResultInfo]
Review Comment:
Why is return different?
--
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
[GitHub] [ofbiz-framework] danwatford commented on pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1513021758
Closing as a rebased version of this PR's branch was handled through #618 .
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1398487745
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1398652052
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1398629856
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1132562408
##########
applications/order/groovyScripts/entry/AdditionalPartyListing.groovy:
##########
@@ -26,20 +26,20 @@ roleData = [:]
partyData = [:]
additionalPartyRole.each { roleTypeId, partyList ->
- roleData[roleTypeId] = from("RoleType").where("roleTypeId", roleTypeId).queryOne()
+ roleData[roleTypeId] = from('RoleType').where('roleTypeId', roleTypeId).queryOne()
partyList.each { partyId ->
partyMap = [:]
partyMap.partyId = partyId
- party = from("Party").where("partyId", partyId).cache(true).queryOne()
- if ("PERSON".equals(party.partyTypeId)) {
- party = party.getRelatedOne("Person", true)
- partyMap.type = "person"
+ party = from('Party').where('partyId', partyId).cache(true).queryOne()
+ if (party.partyTypeId == 'PERSON') {
Review Comment:
Ok with the improvment
##########
applications/order/groovyScripts/entry/BillSettings.groovy:
##########
@@ -66,20 +66,20 @@ if (cart) {
checkOutPaymentId = cart.getPaymentMethodIds().get(0)
context.checkOutPaymentId = checkOutPaymentId
if (!orderParty) {
- paymentMethod = from("PaymentMethod").where("paymentMethodId", checkOutPaymentId).queryOne()
- if ("CREDIT_CARD".equals(paymentMethod?.paymentMethodTypeId)) {
- paymentMethodType = "CC"
- account = paymentMethod.getRelatedOne("CreditCard", false)
+ paymentMethod = from('PaymentMethod').where('paymentMethodId', checkOutPaymentId).queryOne()
+ if (paymentMethod?.paymentMethodTypeId == 'CREDIT_CARD') {
+ paymentMethodType = 'CC'
+ account = paymentMethod.getRelatedOne('CreditCard', false)
context.creditCard = account
context.paymentMethodType = paymentMethodType
- } else if ("EFT_ACCOUNT".equals(paymentMethod.paymentMethodTypeId)) {
- paymentMethodType = "EFT"
- account = paymentMethod.getRelatedOne("EftAccount", false)
+ } else if (paymentMethod.paymentMethodTypeId == 'EFT_ACCOUNT') {
Review Comment:
Ok with the improvment
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1124542128
##########
applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgFinAccountTests.groovy:
##########
@@ -179,20 +178,26 @@ class AutoAcctgFinAccountTests extends OFBizTestCase {
assert serviceResult.finAccountAuthId != null
}
- void setFinAccountTransStatus() {
+ void testSetFinAccountTransStatus() {
Map serviceCtx = [
finAccountTransId: '1010',
statusId: 'FINACT_TRNS_APPROVED',
userLogin: userLogin
]
+ GenericValue finAccountTrans = from('FinAccountTrans')
+ .where('finAccountTransId', '1010')
+ .queryOne()
+ String oldStatusId = finAccountTrans.statusId
+
Map serviceResult = dispatcher.runSync('setFinAccountTransStatus', serviceCtx)
assert ServiceUtil.isSuccess(serviceResult)
- GenericValue finAccountTrans = from('FinAccountTrans')
+ finAccountTrans = from('FinAccountTrans')
.where('finAccountTransId', '1010')
.queryOne()
assert finAccountTrans
assert finAccountTrans.statusId == 'FINACT_TRNS_APPROVED'
- assert finAccountTrans.oldStatusId == 'FINACT_TRNS_CREATED'
Review Comment:
Oh I remember this one, this was a test that was implemented but was never played due to its naming.
I fixed that by renaming the `setFinAccountTransStatus` method to `testSetFinAccountTransStatus`.
Result the test was failing, i guessed that the service behind used to send back oldStatusId, but was modified in the past.
To make the test pass, i extracted lin 190 the status before calling service. Hence the removal of the map reference you detected.
If that is ok we can resolve the discussion :)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1367229517
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1143063628
##########
applications/product/groovyScripts/facility/shipment/PrintPickSheets.groovy:
##########
@@ -60,16 +59,18 @@ if (toPrintOrders) {
orderMap.orderId = orderId
orderMap.orderDate = orderHeader.orderDate
billingOrderContactMechs = []
- billingOrderContactMechs = from("OrderContactMech").where("orderId", orderId, "contactMechPurposeTypeId", "BILLING_LOCATION").queryList()
+ billingOrderContactMechs = from('OrderContactMech')
+ .where('orderId', orderId, 'contactMechPurposeTypeId', 'BILLING_LOCATION').queryList()
if (billingOrderContactMechs.size() > 0) {
billingContactMechId = EntityUtil.getFirst(billingOrderContactMechs).contactMechId
- billingAddress = from("PostalAddress").where("contactMechId", billingContactMechId).queryOne()
+ billingAddress = from('PostalAddress').where('contactMechId', billingContactMechId).queryOne()
}
- shippingContactMechId = from("OrderContactMech").where("orderId", orderId, "contactMechPurposeTypeId", "SHIPPING_LOCATION").queryFirst().contactMechId
- shippingAddress = from("PostalAddress").where("contactMechId", shippingContactMechId).queryOne()
+ shippingContactMechId = from('OrderContactMech')
+ .where('orderId', orderId, 'contactMechPurposeTypeId', 'SHIPPING_LOCATION').queryFirst().contactMechId
+ shippingAddress = from('PostalAddress').where('contactMechId', shippingContactMechId).queryOne()
orderItemShipGroups.each { orderItemShipGroup ->
if (orderItemShipGroup.orderId == orderId) {
- orderMap.shipmentMethodType = EntityUtil.getFirst(orderItemShipGroup.getRelated("ShipmentMethodType", null, null, false)).description
+ orderMap.shipmentMethodType = orderItemShipGroup.getRelated('ShipmentMethodType', null, null, false)[0]?.description
Review Comment:
Why replacing getFirst?
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1149424820
##########
applications/order/groovyScripts/shoppinglist/ShoppingListServices.groovy:
##########
@@ -320,13 +299,20 @@ def addSuggestionsToShoppingList() {
}
private List<GenericValue> linkProductToShoppingList(String productId, String shoppingListId) {
- from("ProductAssoc")
- .where(productId: productId,
- productAssocTypeId: "PRODUCT_COMPLEMENT")
- .filterByDate()
- .queryList().each {
- run service: "addDistinctShoppingListItem", with: [productId : it.productIdTo,
- shoppingListId: shoppingListId,
- quantity : (BigDecimal) 1]
+ from('ProductAssoc')
+ .where(productId: productId,
+ productAssocTypeId: 'PRODUCT_COMPLEMENT')
+ .filterByDate()
+ .queryList().each {
+ run service: 'addDistinctShoppingListItem', with: [productId: it.productIdTo,
+ shoppingListId: shoppingListId,
+ quantity: (BigDecimal) 1]
+ }
+}
+
+private void updateLastAdminModified(GenericValue shoppingList, GenericValue userLogin) {
Review Comment:
To fix the rule PublicMethodsBeforeNonPublicMethods rules : Enforce that all public methods are above protected and private methods.
--
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
[GitHub] [ofbiz-framework] danwatford commented on a diff in pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1182473497
SonarCloud Quality Gate failed. [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![9.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png '9.4%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [9.4% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1367925734
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] danwatford commented on a diff in pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1146202300
##########
applications/product/groovyScripts/product/product/ProductServices.groovy:
##########
@@ -841,22 +867,24 @@ def checkOrderItemForProductGroupOrder() {
/**
* Cancle OrderItemGroupOrder
*/
-def cancleOrderItemGroupOrder() {
+Map cancleOrderItemGroupOrder() {
Review Comment:
I appreciate this seems a simple change and is an overall improvement, but my concern is that all these little 'fixes' will add up to something that is different to the original aim of translating the existing code to satisfy the Codenarc rules and therefore adds to the cognitive load for someone to review the changes.
My preference would be to leave existing behaviour as it is, and create some other 'good housekeeping' tickets to be applied after this PR is merged.
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147426708
##########
applications/party/groovyScripts/party/EditPaymentMethod.groovy:
##########
@@ -38,24 +38,36 @@ context.postalAddressInfos = ContactMechWorker.getPartyPostalAddresses(request,
tryEntity = paymentResults.tryEntity
creditCardData = paymentResults.creditCard
-if (!tryEntity) creditCardData = parameters
-context.creditCardData = creditCardData ?:[:]
+if (!tryEntity) {
Review Comment:
We could group all `if (!tryEntity)`
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147819896
##########
applications/order/groovyScripts/shoppinglist/ShoppingListServices.groovy:
##########
@@ -131,39 +123,30 @@ def updateShoppingListItem() {
/**
* Remove a ShoppingListItem
- * @return
*/
-def removeShoppingListItem() {
- GenericValue shoppingList = from("ShoppingList").where(parameters).queryOne()
- GenericValue shoppingListItem = from("ShoppingListItem").where(parameters).queryOne()
+Map removeShoppingListItem() {
+ GenericValue shoppingList = from('ShoppingList').where(parameters).queryOne()
+ GenericValue shoppingListItem = from('ShoppingListItem').where(parameters).queryOne()
shoppingListItem.remove()
updateLastAdminModified(shoppingList, userLogin)
return success()
}
Review Comment:
What method was removed ? I only see return type and GString to string modifications ?
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1143019683
##########
applications/product/groovyScripts/facility/inventory/InventoryItemTotals.groovy:
##########
@@ -31,30 +32,30 @@ retailPriceGrandTotal = 0.0
totalCostPriceGrandTotal = 0.0
totalRetailPriceGrandTotal = 0.0
boolean beganTransaction = false
-searchParameterString = "action=Y&facilityId=" + facilityId
+searchParameterString = 'action=Y&facilityId=' + facilityId
if (action) {
- conditions = [EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "INV_DELIVERED")]
- conditions.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, null))
+ conditions = [EntityCondition.makeCondition('statusId', EntityOperator.NOT_EQUAL, 'INV_DELIVERED')]
+ conditions.add(EntityCondition.makeCondition('statusId', EntityOperator.EQUALS, null))
conditionList = EntityCondition.makeCondition(conditions, EntityOperator.OR)
try {
beganTransaction = TransactionUtil.begin()
- invItemListItr = from("InventoryItem").where(conditionList).orderBy("productId").queryIterator()
+ invItemListItr = from('InventoryItem').where(conditionList).orderBy('productId').queryIterator()
while ((inventoryItem = invItemListItr.next()) != null) {
productId = inventoryItem.productId
- product = from("Product").where("productId", productId).queryOne()
- productFacility = from("ProductFacility").where("productId", productId, "facilityId", facilityId).queryOne()
+ product = from('Product').where('productId', productId).queryOne()
+ productFacility = from('ProductFacility').where('productId', productId, 'facilityId', facilityId).queryOne()
if (productFacility) {
- quantityOnHandTotal = inventoryItem.getDouble("quantityOnHandTotal")
- availableToPromiseTotal = inventoryItem.getDouble("availableToPromiseTotal")
- costPrice = inventoryItem.getDouble("unitCost")
+ quantityOnHandTotal = inventoryItem.getDouble('quantityOnHandTotal')
+ availableToPromiseTotal = inventoryItem.getDouble('availableToPromiseTotal')
+ costPrice = inventoryItem.getDouble('unitCost')
retailPrice = 0.0
totalCostPrice = 0.0
totalRetailPrice = 0.0
- productPrices = product.getRelated("ProductPrice", null, null, false)
+ productPrices = product.getRelated('ProductPrice', null, null, false)
if (productPrices) {
productPrices.each { productPrice ->
- if (("DEFAULT_PRICE").equals(productPrice.productPriceTypeId)) {
- retailPrice = productPrice.getDouble("price")
+ if (productPrice.productPriceTypeId == ("DEFAULT_PRICE")) {
Review Comment:
Why not using single quotes here?
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147852121
##########
applications/order/groovyScripts/shoppinglist/ShoppingListServices.groovy:
##########
@@ -131,39 +123,30 @@ def updateShoppingListItem() {
/**
* Remove a ShoppingListItem
- * @return
*/
-def removeShoppingListItem() {
- GenericValue shoppingList = from("ShoppingList").where(parameters).queryOne()
- GenericValue shoppingListItem = from("ShoppingListItem").where(parameters).queryOne()
+Map removeShoppingListItem() {
+ GenericValue shoppingList = from('ShoppingList').where(parameters).queryOne()
+ GenericValue shoppingListItem = from('ShoppingListItem').where(parameters).queryOne()
shoppingListItem.remove()
updateLastAdminModified(shoppingList, userLogin)
return success()
}
Review Comment:
Not removed, moved
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1132561264
##########
applications/marketing/groovyScripts/marketing/reports/MarketingCampaignReport.groovy:
##########
@@ -23,26 +23,28 @@ import org.apache.ofbiz.marketing.report.ReportHelper
//query for both number of visits and number of orders
-marketingCampaignId = request.getParameter("marketingCampaignId")
+marketingCampaignId = request.getParameter('marketingCampaignId')
visitConditionList = [] as LinkedList
orderConditionList = [] as LinkedList
if (fromDate) {
- visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
- orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
+ visitConditionList.add(EntityCondition.makeCondition('fromDate', EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
+ orderConditionList.add(EntityCondition.makeCondition('orderDate', EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
}
if (thruDate) {
- visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
- orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
+ visitConditionList.add(EntityCondition.makeCondition('fromDate', EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
+ orderConditionList.add(EntityCondition.makeCondition('orderDate', EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
}
if (marketingCampaignId) {
- visitConditionList.add(EntityCondition.makeCondition("marketingCampaignId", EntityOperator.EQUALS, marketingCampaignId))
- orderConditionList.add(EntityCondition.makeCondition("marketingCampaignId", EntityOperator.EQUALS, marketingCampaignId))
+ visitConditionList.add(EntityCondition.makeCondition('marketingCampaignId', EntityOperator.EQUALS, marketingCampaignId))
+ orderConditionList.add(EntityCondition.makeCondition('marketingCampaignId', EntityOperator.EQUALS, marketingCampaignId))
}
-visits = select("marketingCampaignId", "visitId").from("MarketingCampaignAndVisit").where(visitConditionList).orderBy("marketingCampaignId").queryList()
-orders = select("marketingCampaignId", "orderId", "grandTotal").from("MarketingCampaignAndOrderHeader").where(orderConditionList).orderBy("marketingCampaignId").queryList()
+visits = select('marketingCampaignId', 'visitId')
+ .from('MarketingCampaignAndVisit').where(visitConditionList).orderBy('marketingCampaignId').queryList()
+orders = select('marketingCampaignId', 'orderId', 'grandTotal')
+ .from('MarketingCampaignAndOrderHeader').where(orderConditionList).orderBy('marketingCampaignId').queryList()
Review Comment:
Ok with the improvment
--
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
[GitHub] [ofbiz-framework] danwatford commented on pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1436476949
> Hi Gil, Daniel,
>
> Before pushing, would it be possible to have something like https://gitbox.apache.org/repos/asf?p=ofbiz-tools.git;a=blob_plain;f=wiki-files/OFBizJavaFormatter.xml ? See https://cwiki.apache.org/confluence/display/OFBIZ/Coding+Conventions for details
Hi @JacquesLeRoux , I would expect this to be possible. I don't use Eclipse, so cannot produce the file myself.
CodeNarc will be policing groovy code style for us to a certain extent, but it would be nice to have our IDEs help us apply a compliant style while authoring code. The configuration files (profiles) could target Eclipse since they can also be imported into IntelliJ.
I would suggest creating a separate ticket to 'create IDE profiles for groovy styling' as we already have a lot do take care of with this ticket.
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1497118176
SonarCloud Quality Gate failed. [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![C](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/C-16px.png 'C')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [1 Bug](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [3 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] danwatford commented on a diff in pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1158236705
##########
framework/webtools/groovyScripts/entity/XmlDsDump.groovy:
##########
@@ -17,151 +17,158 @@
* under the License.
*/
-import java.util.*
-import java.io.*
-import org.apache.ofbiz.base.util.*
-import org.apache.ofbiz.entity.model.*
-import org.apache.ofbiz.entity.util.*
-import org.apache.ofbiz.entity.transaction.*
-import org.apache.ofbiz.entity.condition.*
+import org.apache.ofbiz.base.util.Debug
+import org.apache.ofbiz.base.util.UtilFormatOut
+import org.apache.ofbiz.entity.condition.EntityComparisonOperator
+import org.apache.ofbiz.entity.condition.EntityCondition
+import org.apache.ofbiz.entity.condition.EntityJoinOperator
+import org.apache.ofbiz.entity.model.ModelViewEntity
+import org.apache.ofbiz.entity.transaction.TransactionUtil
+import org.apache.ofbiz.entity.util.EntityFindOptions
outpath = parameters.outpath
filename = parameters.filename
maxRecStr = parameters.maxrecords
entitySyncId = parameters.entitySyncId
passedEntityNames = null
-if (parameters.entityName) passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet
+if (parameters.entityName) {
+ passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet
+}
// get the max records per file setting and convert to a int
-maxRecordsPerFile = 0
-if (maxRecStr) {
- try {
- maxRecordsPerFile = Integer.parseInt(maxRecStr)
- }
- catch (Exception e) {
- }
-}
+int maxRecordsPerFile = maxRecStr ? (maxRecStr as int) : 0
Review Comment:
No, I'm saying that the use of isInteger code is missing from the PR at this time.
Once the suggested change, `&& maxRecStr.isInteger()`, has been committed to this PR then this review can be resolved.
--
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
[GitHub] [ofbiz-framework] gilPts commented on pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1498992879
>
About BalanceSheet.groovy and others framework groovy file, I can rebase this branch onto trunk and process the files that are detected by codenarc, then push in another pull request listing the files I worked on.
That will let us review those quickly and finish that work.
--
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
[GitHub] [ofbiz-framework] danwatford commented on pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1497582302
> @danwatford , it's possible conflicts related to change for https://issues.apache.org/jira/browse/OFBIZ-12793 "Cannot add a new geo point to a facility"
Good news indeed then since, assuming Nicolas' questions have been resolved, that means the only outstanding things left on this PR is to resolve the merge conflicts, which includes FacilityGeoServices.groovy.
@JacquesLeRoux I think it is ok to mark FacilityGeoServices.groovy as PASSED since merge conflicts affect more that just that single file. Or alternatively we should mark all the conflicted files as NEEDS_WORK to highlight that some action still remains to be done?
--
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
[GitHub] [ofbiz-framework] danwatford commented on a diff in pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1157497733
##########
applications/product/groovyScripts/facility/facility/CountFacilityInventoryByProduct.groovy:
##########
@@ -55,165 +57,168 @@ 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)
+ prodView.with {
+ addMemberEntity('PRFA', 'ProductFacility')
+ addAlias('PRFA', 'productId', null, null, null, Boolean.TRUE, null)
+ addAlias('PRFA', 'minimumStock', null, null, null, Boolean.TRUE, null)
+ addAlias('PRFA', 'reorderQuantity', null, null, null, Boolean.TRUE, null)
+ addAlias('PRFA', 'daysToShip', null, null, null, Boolean.TRUE, null)
+ addAlias('PRFA', 'facilityId', null, null, null, Boolean.TRUE, null)
+
+ addMemberEntity('PROD', 'Product')
+ addViewLink('PROD', 'PRFA', Boolean.FALSE, ModelKeyMap.makeKeyMapList('productId'))
+ addAlias('PROD', 'internalName', null, null, null, Boolean.TRUE, null)
+ addAlias('PROD', 'isVirtual', null, null, null, Boolean.TRUE, null)
+ addAlias('PROD', 'salesDiscontinuationDate', null, null, null, Boolean.TRUE, null)
+ }
if (productTypeId) {
- prodView.addAlias("PROD", "productTypeId", null, null, null, Boolean.TRUE, null)
+ prodView.addAlias('PROD', 'productTypeId', null, null, null, Boolean.TRUE, null)
conditionMap.productTypeId = productTypeId
- searchParameterString = searchParameterString + "&productTypeId=" + productTypeId
+ searchParameterString = searchParameterString + '&productTypeId=' + productTypeId
}
- prodView.addMemberEntity("IITE", "InventoryItem")
- prodView.addViewLink("PRFA", "IITE", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId", "productId", "facilityId", "facilityId"))
- prodView.addAlias("IITE", "totalQuantityOnHandTotal", "quantityOnHandTotal", null, null, null, "sum")
- prodView.addAlias("IITE", "totalAvailableToPromiseTotal", "availableToPromiseTotal", null, null, null, "sum")
- qohDiffComplexAlias = new ComplexAlias("-")
- qohDiffComplexAlias.addComplexAliasMember(new ComplexAliasField("IITE", "quantityOnHandTotal", null, "sum"))
- qohDiffComplexAlias.addComplexAliasMember(new ComplexAliasField("PRFA", "minimumStock", null, null))
- prodView.addAlias(null, "offsetQOHQtyAvailable", null, null, null, null, null, qohDiffComplexAlias)
- atpDiffComplexAlias = new ComplexAlias("-")
- atpDiffComplexAlias.addComplexAliasMember(new ComplexAliasField("IITE", "availableToPromiseTotal", null, "sum"))
- atpDiffComplexAlias.addComplexAliasMember(new ComplexAliasField("PRFA", "minimumStock", null, null))
- prodView.addAlias(null, "offsetATPQtyAvailable", null, null, null, null, null, atpDiffComplexAlias)
+ prodView.addMemberEntity('IITE', 'InventoryItem')
+ prodView.addViewLink('PRFA', 'IITE', Boolean.FALSE, ModelKeyMap.makeKeyMapList('productId', 'productId', 'facilityId', 'facilityId'))
+ prodView.addAlias('IITE', 'totalQuantityOnHandTotal', 'quantityOnHandTotal', null, null, null, 'sum')
+ prodView.addAlias('IITE', 'totalAvailableToPromiseTotal', 'availableToPromiseTotal', null, null, null, 'sum')
+ qohDiffComplexAlias = new ComplexAlias('-')
+ qohDiffComplexAlias.addComplexAliasMember(new ComplexAliasField('IITE', 'quantityOnHandTotal', null, 'sum'))
+ qohDiffComplexAlias.addComplexAliasMember(new ComplexAliasField('PRFA', 'minimumStock', null, null))
+ prodView.addAlias(null, 'offsetQOHQtyAvailable', null, null, null, null, null, qohDiffComplexAlias)
+ atpDiffComplexAlias = new ComplexAlias('-')
+ atpDiffComplexAlias.addComplexAliasMember(new ComplexAliasField('IITE', 'availableToPromiseTotal', null, 'sum'))
+ atpDiffComplexAlias.addComplexAliasMember(new ComplexAliasField('PRFA', 'minimumStock', null, null))
+ prodView.addAlias(null, 'offsetATPQtyAvailable', null, null, null, null, null, atpDiffComplexAlias)
if (searchInProductCategoryId) {
- prodView.addMemberEntity("PRCA", "ProductCategoryMember")
- prodView.addViewLink("PRFA", "PRCA", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"))
- prodView.addAlias("PRCA", "productCategoryId", null, null, null, Boolean.TRUE, null)
+ prodView.addMemberEntity('PRCA', 'ProductCategoryMember')
+ prodView.addViewLink('PRFA', 'PRCA', Boolean.FALSE, ModelKeyMap.makeKeyMapList('productId'))
+ prodView.addAlias('PRCA', 'productCategoryId', null, null, null, Boolean.TRUE, null)
conditionMap.productCategoryId = searchInProductCategoryId
- searchParameterString = searchParameterString + "&searchInProductCategoryId=" + searchInProductCategoryId
+ searchParameterString = searchParameterString + '&searchInProductCategoryId=' + searchInProductCategoryId
}
if (productSupplierId) {
- prodView.addMemberEntity("SPPR", "SupplierProduct")
- prodView.addViewLink("PRFA", "SPPR", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"))
- prodView.addAlias("SPPR", "partyId", null, null, null, Boolean.TRUE, null)
+ prodView.addMemberEntity('SPPR', 'SupplierProduct')
+ prodView.addViewLink('PRFA', 'SPPR', Boolean.FALSE, ModelKeyMap.makeKeyMapList('productId'))
+ prodView.addAlias('SPPR', 'partyId', null, null, null, Boolean.TRUE, null)
conditionMap.partyId = productSupplierId
- searchParameterString = searchParameterString + "&productSupplierId=" + productSupplierId
+ searchParameterString = searchParameterString + '&productSupplierId=' + productSupplierId
}
// set distinct on so we only get one row per product
searchCondition = EntityCondition.makeCondition(conditionMap, EntityOperator.AND)
- notVirtualCondition = EntityCondition.makeCondition(EntityCondition.makeCondition("isVirtual", EntityOperator.EQUALS, null),
+ notVirtualCondition = EntityCondition.makeCondition(EntityCondition.makeCondition('isVirtual', EntityOperator.EQUALS, null),
EntityOperator.OR,
- EntityCondition.makeCondition("isVirtual", EntityOperator.NOT_EQUAL, "Y"))
+ EntityCondition.makeCondition('isVirtual', EntityOperator.NOT_EQUAL, 'Y'))
whereConditionsList = [searchCondition, notVirtualCondition]
// add the discontinuation date condition
if (productsSoldThruTimestamp) {
discontinuationDateCondition = EntityCondition.makeCondition(
[
- EntityCondition.makeCondition("salesDiscontinuationDate", EntityOperator.EQUALS, null),
- EntityCondition.makeCondition("salesDiscontinuationDate", EntityOperator.GREATER_THAN,productsSoldThruTimestamp)
+ EntityCondition.makeCondition('salesDiscontinuationDate', EntityOperator.EQUALS, null),
+ EntityCondition.makeCondition('salesDiscontinuationDate', EntityOperator.GREATER_THAN, productsSoldThruTimestamp)
],
EntityOperator.OR)
whereConditionsList.add(discontinuationDateCondition)
- searchParameterString = searchParameterString + "&productsSoldThruTimestamp=" + productsSoldThruTimestamp
+ searchParameterString = searchParameterString + '&productsSoldThruTimestamp=' + productsSoldThruTimestamp
}
// add search on internal name
if (internalName) {
- whereConditionsList.add(EntityCondition.makeCondition("internalName", EntityOperator.LIKE, "%" + internalName + "%"))
- searchParameterString = searchParameterString + "&internalName=" + internalName
+ whereConditionsList.add(EntityCondition.makeCondition('internalName', EntityOperator.LIKE, '%' + internalName + '%'))
+ searchParameterString = searchParameterString + '&internalName=' + internalName
}
// add search on productId
if (productId) {
- whereConditionsList.add(EntityCondition.makeCondition("productId", EntityOperator.LIKE, productId + "%"))
- searchParameterString = searchParameterString + "&productId=" + productId
+ whereConditionsList.add(EntityCondition.makeCondition('productId', EntityOperator.LIKE, productId + '%'))
+ searchParameterString = searchParameterString + '&productId=' + productId
}
orderBy = []
if (hasOffsetATP) {
- orderBy.add("offsetATPQtyAvailable")
+ orderBy.add('offsetATPQtyAvailable')
}
if (hasOffsetQOH) {
- orderBy.add("offsetQOHQtyAvailable")
+ orderBy.add('offsetQOHQtyAvailable')
}
- orderBy.add("productId")
+ orderBy.add('productId')
// If the user has specified a number of months over which to sum usage quantities, define the correct timestamp
checkTime = null
- monthsInPastLimitStr = request.getParameter("monthsInPastLimit")
+ monthsInPastLimitStr = request.getParameter('monthsInPastLimit')
if (monthsInPastLimitStr) {
try {
monthsInPastLimit = Integer.parseInt(monthsInPastLimitStr)
cal = UtilDateTime.toCalendar(null)
cal.add(Calendar.MONTH, 0 - monthsInPastLimit)
checkTime = UtilDateTime.toTimestamp(cal.getTime())
- searchParameterString += "&monthsInPastLimit=" + monthsInPastLimitStr
+ searchParameterString += '&monthsInPastLimit=' + monthsInPastLimitStr
} catch (Exception e) {
- logError(e, "Caught an exception : " + e.toString())
- request.setAttribute("_ERROR_MESSAGE", "An exception occured please check the log")
+ logError(e, 'Caught an exception : ' + e)
+ request.setAttribute('_ERROR_MESSAGE', 'An exception occured please check the log')
}
}
if (checkTime) {
-
// Construct a dynamic view entity to search against for sales usage quantities
- salesUsageViewEntity = new DynamicViewEntity()
- salesUsageViewEntity.addMemberEntity("OI", "OrderItem")
- salesUsageViewEntity.addMemberEntity("OH", "OrderHeader")
- salesUsageViewEntity.addMemberEntity("ItIss", "ItemIssuance")
- salesUsageViewEntity.addMemberEntity("InvIt", "InventoryItem")
- salesUsageViewEntity.addViewLink("OI", "OH", false, ModelKeyMap.makeKeyMapList("orderId"))
- salesUsageViewEntity.addViewLink("OI", "ItIss", false, ModelKeyMap.makeKeyMapList("orderId", "orderId", "orderItemSeqId", "orderItemSeqId"))
- salesUsageViewEntity.addViewLink("ItIss", "InvIt", false, ModelKeyMap.makeKeyMapList("inventoryItemId"))
- salesUsageViewEntity.addAlias("OI", "productId")
- salesUsageViewEntity.addAlias("OH", "statusId")
- salesUsageViewEntity.addAlias("OH", "orderTypeId")
- salesUsageViewEntity.addAlias("OH", "orderDate")
- salesUsageViewEntity.addAlias("ItIss", "inventoryItemId")
- salesUsageViewEntity.addAlias("ItIss", "quantity")
- salesUsageViewEntity.addAlias("InvIt", "facilityId")
+ salesUsageViewEntity = new DynamicViewEntity().with {
+ addMemberEntity('OI', 'OrderItem')
+ addMemberEntity('OH', 'OrderHeader')
+ addMemberEntity('ItIss', 'ItemIssuance')
+ addMemberEntity('InvIt', 'InventoryItem')
+ addViewLink('OI', 'OH', false, ModelKeyMap.makeKeyMapList('orderId'))
+ addViewLink('OI', 'ItIss', false, ModelKeyMap.makeKeyMapList('orderId', 'orderId', 'orderItemSeqId', 'orderItemSeqId'))
+ addViewLink('ItIss', 'InvIt', false, ModelKeyMap.makeKeyMapList('inventoryItemId'))
+ addAlias('OI', 'productId')
+ addAlias('OH', 'statusId')
+ addAlias('OH', 'orderTypeId')
+ addAlias('OH', 'orderDate')
+ addAlias('ItIss', 'inventoryItemId')
+ addAlias('ItIss', 'quantity')
+ addAlias('InvIt', 'facilityId')
+ }
Review Comment:
Need to return `it` for assignment to `salesUsageViewEntity`
##########
applications/product/groovyScripts/facility/facility/CountFacilityInventoryByProduct.groovy:
##########
@@ -55,165 +57,168 @@ 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)
+ prodView.with {
+ addMemberEntity('PRFA', 'ProductFacility')
+ addAlias('PRFA', 'productId', null, null, null, Boolean.TRUE, null)
+ addAlias('PRFA', 'minimumStock', null, null, null, Boolean.TRUE, null)
+ addAlias('PRFA', 'reorderQuantity', null, null, null, Boolean.TRUE, null)
+ addAlias('PRFA', 'daysToShip', null, null, null, Boolean.TRUE, null)
+ addAlias('PRFA', 'facilityId', null, null, null, Boolean.TRUE, null)
+
+ addMemberEntity('PROD', 'Product')
+ addViewLink('PROD', 'PRFA', Boolean.FALSE, ModelKeyMap.makeKeyMapList('productId'))
+ addAlias('PROD', 'internalName', null, null, null, Boolean.TRUE, null)
+ addAlias('PROD', 'isVirtual', null, null, null, Boolean.TRUE, null)
+ addAlias('PROD', 'salesDiscontinuationDate', null, null, null, Boolean.TRUE, null)
+ }
if (productTypeId) {
- prodView.addAlias("PROD", "productTypeId", null, null, null, Boolean.TRUE, null)
+ prodView.addAlias('PROD', 'productTypeId', null, null, null, Boolean.TRUE, null)
conditionMap.productTypeId = productTypeId
- searchParameterString = searchParameterString + "&productTypeId=" + productTypeId
+ searchParameterString = searchParameterString + '&productTypeId=' + productTypeId
}
- prodView.addMemberEntity("IITE", "InventoryItem")
- prodView.addViewLink("PRFA", "IITE", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId", "productId", "facilityId", "facilityId"))
- prodView.addAlias("IITE", "totalQuantityOnHandTotal", "quantityOnHandTotal", null, null, null, "sum")
- prodView.addAlias("IITE", "totalAvailableToPromiseTotal", "availableToPromiseTotal", null, null, null, "sum")
- qohDiffComplexAlias = new ComplexAlias("-")
- qohDiffComplexAlias.addComplexAliasMember(new ComplexAliasField("IITE", "quantityOnHandTotal", null, "sum"))
- qohDiffComplexAlias.addComplexAliasMember(new ComplexAliasField("PRFA", "minimumStock", null, null))
- prodView.addAlias(null, "offsetQOHQtyAvailable", null, null, null, null, null, qohDiffComplexAlias)
- atpDiffComplexAlias = new ComplexAlias("-")
- atpDiffComplexAlias.addComplexAliasMember(new ComplexAliasField("IITE", "availableToPromiseTotal", null, "sum"))
- atpDiffComplexAlias.addComplexAliasMember(new ComplexAliasField("PRFA", "minimumStock", null, null))
- prodView.addAlias(null, "offsetATPQtyAvailable", null, null, null, null, null, atpDiffComplexAlias)
+ prodView.addMemberEntity('IITE', 'InventoryItem')
+ prodView.addViewLink('PRFA', 'IITE', Boolean.FALSE, ModelKeyMap.makeKeyMapList('productId', 'productId', 'facilityId', 'facilityId'))
+ prodView.addAlias('IITE', 'totalQuantityOnHandTotal', 'quantityOnHandTotal', null, null, null, 'sum')
+ prodView.addAlias('IITE', 'totalAvailableToPromiseTotal', 'availableToPromiseTotal', null, null, null, 'sum')
+ qohDiffComplexAlias = new ComplexAlias('-')
+ qohDiffComplexAlias.addComplexAliasMember(new ComplexAliasField('IITE', 'quantityOnHandTotal', null, 'sum'))
+ qohDiffComplexAlias.addComplexAliasMember(new ComplexAliasField('PRFA', 'minimumStock', null, null))
+ prodView.addAlias(null, 'offsetQOHQtyAvailable', null, null, null, null, null, qohDiffComplexAlias)
+ atpDiffComplexAlias = new ComplexAlias('-')
+ atpDiffComplexAlias.addComplexAliasMember(new ComplexAliasField('IITE', 'availableToPromiseTotal', null, 'sum'))
+ atpDiffComplexAlias.addComplexAliasMember(new ComplexAliasField('PRFA', 'minimumStock', null, null))
+ prodView.addAlias(null, 'offsetATPQtyAvailable', null, null, null, null, null, atpDiffComplexAlias)
if (searchInProductCategoryId) {
- prodView.addMemberEntity("PRCA", "ProductCategoryMember")
- prodView.addViewLink("PRFA", "PRCA", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"))
- prodView.addAlias("PRCA", "productCategoryId", null, null, null, Boolean.TRUE, null)
+ prodView.addMemberEntity('PRCA', 'ProductCategoryMember')
+ prodView.addViewLink('PRFA', 'PRCA', Boolean.FALSE, ModelKeyMap.makeKeyMapList('productId'))
+ prodView.addAlias('PRCA', 'productCategoryId', null, null, null, Boolean.TRUE, null)
conditionMap.productCategoryId = searchInProductCategoryId
- searchParameterString = searchParameterString + "&searchInProductCategoryId=" + searchInProductCategoryId
+ searchParameterString = searchParameterString + '&searchInProductCategoryId=' + searchInProductCategoryId
}
if (productSupplierId) {
- prodView.addMemberEntity("SPPR", "SupplierProduct")
- prodView.addViewLink("PRFA", "SPPR", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"))
- prodView.addAlias("SPPR", "partyId", null, null, null, Boolean.TRUE, null)
+ prodView.addMemberEntity('SPPR', 'SupplierProduct')
+ prodView.addViewLink('PRFA', 'SPPR', Boolean.FALSE, ModelKeyMap.makeKeyMapList('productId'))
+ prodView.addAlias('SPPR', 'partyId', null, null, null, Boolean.TRUE, null)
conditionMap.partyId = productSupplierId
- searchParameterString = searchParameterString + "&productSupplierId=" + productSupplierId
+ searchParameterString = searchParameterString + '&productSupplierId=' + productSupplierId
}
// set distinct on so we only get one row per product
searchCondition = EntityCondition.makeCondition(conditionMap, EntityOperator.AND)
- notVirtualCondition = EntityCondition.makeCondition(EntityCondition.makeCondition("isVirtual", EntityOperator.EQUALS, null),
+ notVirtualCondition = EntityCondition.makeCondition(EntityCondition.makeCondition('isVirtual', EntityOperator.EQUALS, null),
EntityOperator.OR,
- EntityCondition.makeCondition("isVirtual", EntityOperator.NOT_EQUAL, "Y"))
+ EntityCondition.makeCondition('isVirtual', EntityOperator.NOT_EQUAL, 'Y'))
whereConditionsList = [searchCondition, notVirtualCondition]
// add the discontinuation date condition
if (productsSoldThruTimestamp) {
discontinuationDateCondition = EntityCondition.makeCondition(
[
- EntityCondition.makeCondition("salesDiscontinuationDate", EntityOperator.EQUALS, null),
- EntityCondition.makeCondition("salesDiscontinuationDate", EntityOperator.GREATER_THAN,productsSoldThruTimestamp)
+ EntityCondition.makeCondition('salesDiscontinuationDate', EntityOperator.EQUALS, null),
+ EntityCondition.makeCondition('salesDiscontinuationDate', EntityOperator.GREATER_THAN, productsSoldThruTimestamp)
],
EntityOperator.OR)
whereConditionsList.add(discontinuationDateCondition)
- searchParameterString = searchParameterString + "&productsSoldThruTimestamp=" + productsSoldThruTimestamp
+ searchParameterString = searchParameterString + '&productsSoldThruTimestamp=' + productsSoldThruTimestamp
}
// add search on internal name
if (internalName) {
- whereConditionsList.add(EntityCondition.makeCondition("internalName", EntityOperator.LIKE, "%" + internalName + "%"))
- searchParameterString = searchParameterString + "&internalName=" + internalName
+ whereConditionsList.add(EntityCondition.makeCondition('internalName', EntityOperator.LIKE, '%' + internalName + '%'))
+ searchParameterString = searchParameterString + '&internalName=' + internalName
}
// add search on productId
if (productId) {
- whereConditionsList.add(EntityCondition.makeCondition("productId", EntityOperator.LIKE, productId + "%"))
- searchParameterString = searchParameterString + "&productId=" + productId
+ whereConditionsList.add(EntityCondition.makeCondition('productId', EntityOperator.LIKE, productId + '%'))
+ searchParameterString = searchParameterString + '&productId=' + productId
}
orderBy = []
if (hasOffsetATP) {
- orderBy.add("offsetATPQtyAvailable")
+ orderBy.add('offsetATPQtyAvailable')
}
if (hasOffsetQOH) {
- orderBy.add("offsetQOHQtyAvailable")
+ orderBy.add('offsetQOHQtyAvailable')
}
- orderBy.add("productId")
+ orderBy.add('productId')
// If the user has specified a number of months over which to sum usage quantities, define the correct timestamp
checkTime = null
- monthsInPastLimitStr = request.getParameter("monthsInPastLimit")
+ monthsInPastLimitStr = request.getParameter('monthsInPastLimit')
if (monthsInPastLimitStr) {
try {
monthsInPastLimit = Integer.parseInt(monthsInPastLimitStr)
cal = UtilDateTime.toCalendar(null)
cal.add(Calendar.MONTH, 0 - monthsInPastLimit)
checkTime = UtilDateTime.toTimestamp(cal.getTime())
- searchParameterString += "&monthsInPastLimit=" + monthsInPastLimitStr
+ searchParameterString += '&monthsInPastLimit=' + monthsInPastLimitStr
} catch (Exception e) {
- logError(e, "Caught an exception : " + e.toString())
- request.setAttribute("_ERROR_MESSAGE", "An exception occured please check the log")
+ logError(e, 'Caught an exception : ' + e)
+ request.setAttribute('_ERROR_MESSAGE', 'An exception occured please check the log')
}
}
if (checkTime) {
-
// Construct a dynamic view entity to search against for sales usage quantities
- salesUsageViewEntity = new DynamicViewEntity()
- salesUsageViewEntity.addMemberEntity("OI", "OrderItem")
- salesUsageViewEntity.addMemberEntity("OH", "OrderHeader")
- salesUsageViewEntity.addMemberEntity("ItIss", "ItemIssuance")
- salesUsageViewEntity.addMemberEntity("InvIt", "InventoryItem")
- salesUsageViewEntity.addViewLink("OI", "OH", false, ModelKeyMap.makeKeyMapList("orderId"))
- salesUsageViewEntity.addViewLink("OI", "ItIss", false, ModelKeyMap.makeKeyMapList("orderId", "orderId", "orderItemSeqId", "orderItemSeqId"))
- salesUsageViewEntity.addViewLink("ItIss", "InvIt", false, ModelKeyMap.makeKeyMapList("inventoryItemId"))
- salesUsageViewEntity.addAlias("OI", "productId")
- salesUsageViewEntity.addAlias("OH", "statusId")
- salesUsageViewEntity.addAlias("OH", "orderTypeId")
- salesUsageViewEntity.addAlias("OH", "orderDate")
- salesUsageViewEntity.addAlias("ItIss", "inventoryItemId")
- salesUsageViewEntity.addAlias("ItIss", "quantity")
- salesUsageViewEntity.addAlias("InvIt", "facilityId")
+ salesUsageViewEntity = new DynamicViewEntity().with {
+ addMemberEntity('OI', 'OrderItem')
+ addMemberEntity('OH', 'OrderHeader')
+ addMemberEntity('ItIss', 'ItemIssuance')
+ addMemberEntity('InvIt', 'InventoryItem')
+ addViewLink('OI', 'OH', false, ModelKeyMap.makeKeyMapList('orderId'))
+ addViewLink('OI', 'ItIss', false, ModelKeyMap.makeKeyMapList('orderId', 'orderId', 'orderItemSeqId', 'orderItemSeqId'))
+ addViewLink('ItIss', 'InvIt', false, ModelKeyMap.makeKeyMapList('inventoryItemId'))
+ addAlias('OI', 'productId')
+ addAlias('OH', 'statusId')
+ addAlias('OH', 'orderTypeId')
+ addAlias('OH', 'orderDate')
+ addAlias('ItIss', 'inventoryItemId')
+ addAlias('ItIss', 'quantity')
+ addAlias('InvIt', 'facilityId')
+ }
// Construct a dynamic view entity to search against for production usage quantities
- productionUsageViewEntity = new DynamicViewEntity()
- productionUsageViewEntity.addMemberEntity("WEIA", "WorkEffortInventoryAssign")
- productionUsageViewEntity.addMemberEntity("WE", "WorkEffort")
- productionUsageViewEntity.addMemberEntity("II", "InventoryItem")
- productionUsageViewEntity.addViewLink("WEIA", "WE", false, ModelKeyMap.makeKeyMapList("workEffortId"))
- productionUsageViewEntity.addViewLink("WEIA", "II", false, ModelKeyMap.makeKeyMapList("inventoryItemId"))
- productionUsageViewEntity.addAlias("WEIA", "quantity")
- productionUsageViewEntity.addAlias("WE", "actualCompletionDate")
- productionUsageViewEntity.addAlias("WE", "workEffortTypeId")
- productionUsageViewEntity.addAlias("II", "facilityId")
- productionUsageViewEntity.addAlias("II", "productId")
+ productionUsageViewEntity = new DynamicViewEntity().with {
+ addMemberEntity('WEIA', 'WorkEffortInventoryAssign')
+ addMemberEntity('WE', 'WorkEffort')
+ addMemberEntity('II', 'InventoryItem')
+ addViewLink('WEIA', 'WE', false, ModelKeyMap.makeKeyMapList('workEffortId'))
+ addViewLink('WEIA', 'II', false, ModelKeyMap.makeKeyMapList('inventoryItemId'))
+ addAlias('WEIA', 'quantity')
+ addAlias('WE', 'actualCompletionDate')
+ addAlias('WE', 'workEffortTypeId')
+ addAlias('II', 'facilityId')
+ addAlias('II', 'productId')
+ }
Review Comment:
Need to return `it` for assignment to `productionUsageViewEntity`
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1186278624
SonarCloud Quality Gate failed. [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![9.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png '9.4%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [9.4% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1381707534
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1381913979
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1373892474
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1100091707
##########
framework/webtools/groovyScripts/entity/XmlDsDump.groovy:
##########
@@ -17,151 +17,158 @@
* under the License.
*/
-import java.util.*
-import java.io.*
-import org.apache.ofbiz.base.util.*
-import org.apache.ofbiz.entity.model.*
-import org.apache.ofbiz.entity.util.*
-import org.apache.ofbiz.entity.transaction.*
-import org.apache.ofbiz.entity.condition.*
+import org.apache.ofbiz.base.util.Debug
+import org.apache.ofbiz.base.util.UtilFormatOut
+import org.apache.ofbiz.entity.condition.EntityComparisonOperator
+import org.apache.ofbiz.entity.condition.EntityCondition
+import org.apache.ofbiz.entity.condition.EntityJoinOperator
+import org.apache.ofbiz.entity.model.ModelViewEntity
+import org.apache.ofbiz.entity.transaction.TransactionUtil
+import org.apache.ofbiz.entity.util.EntityFindOptions
outpath = parameters.outpath
filename = parameters.filename
maxRecStr = parameters.maxrecords
entitySyncId = parameters.entitySyncId
passedEntityNames = null
-if (parameters.entityName) passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet
+if (parameters.entityName) {
+ passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet
+}
// get the max records per file setting and convert to a int
-maxRecordsPerFile = 0
-if (maxRecStr) {
- try {
- maxRecordsPerFile = Integer.parseInt(maxRecStr)
- }
- catch (Exception e) {
- }
-}
+int maxRecordsPerFile = maxRecStr ? (maxRecStr as int) : 0
Review Comment:
I agree with your suggestion, thanks
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1367953125
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1354423131
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1435667612
Hi Gil, Daniel,
Before pushing, would it be possible to have something like https://gitbox.apache.org/repos/asf?p=ofbiz-tools.git;a=blob_plain;f=wiki-files/OFBizJavaFormatter.xml ?
See https://cwiki.apache.org/confluence/display/OFBIZ/Coding+Conventions for details
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1436626800
`I would suggest creating a separate ticket to 'create IDE profiles for groovy styling' as we already have a lot do take care of with this ticket.`
Done with https://issues.apache.org/jira/browse/OFBIZ-12764
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1398560230
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1220809233
SonarCloud Quality Gate failed. [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![9.3%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png '9.3%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [9.3% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1158212716
##########
framework/webtools/groovyScripts/entity/XmlDsDump.groovy:
##########
@@ -17,151 +17,158 @@
* under the License.
*/
-import java.util.*
-import java.io.*
-import org.apache.ofbiz.base.util.*
-import org.apache.ofbiz.entity.model.*
-import org.apache.ofbiz.entity.util.*
-import org.apache.ofbiz.entity.transaction.*
-import org.apache.ofbiz.entity.condition.*
+import org.apache.ofbiz.base.util.Debug
+import org.apache.ofbiz.base.util.UtilFormatOut
+import org.apache.ofbiz.entity.condition.EntityComparisonOperator
+import org.apache.ofbiz.entity.condition.EntityCondition
+import org.apache.ofbiz.entity.condition.EntityJoinOperator
+import org.apache.ofbiz.entity.model.ModelViewEntity
+import org.apache.ofbiz.entity.transaction.TransactionUtil
+import org.apache.ofbiz.entity.util.EntityFindOptions
outpath = parameters.outpath
filename = parameters.filename
maxRecStr = parameters.maxrecords
entitySyncId = parameters.entitySyncId
passedEntityNames = null
-if (parameters.entityName) passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet
+if (parameters.entityName) {
+ passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet
+}
// get the max records per file setting and convert to a int
-maxRecordsPerFile = 0
-if (maxRecStr) {
- try {
- maxRecordsPerFile = Integer.parseInt(maxRecStr)
- }
- catch (Exception e) {
- }
-}
+int maxRecordsPerFile = maxRecStr ? (maxRecStr as int) : 0
Review Comment:
maxRecStr is an user filled data for `Max Records Per File` during xml export. If the user to not fill an integer, this code won't break and maxRecordsPerFile will still be set at default `0` value.
Are you telling that there are some cases that could throw an exception with `isInteger` test to int cast ?
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1499133509
I was actually wondering if Codenarc was providing threshold, according to* it is.
* https://stackoverflow.com/questions/27949345/codenarc-priority-meanings
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147374612
##########
applications/order/groovyScripts/shoppinglist/ShoppingListServices.groovy:
##########
@@ -131,39 +123,30 @@ def updateShoppingListItem() {
/**
* Remove a ShoppingListItem
- * @return
*/
-def removeShoppingListItem() {
- GenericValue shoppingList = from("ShoppingList").where(parameters).queryOne()
- GenericValue shoppingListItem = from("ShoppingListItem").where(parameters).queryOne()
+Map removeShoppingListItem() {
+ GenericValue shoppingList = from('ShoppingList').where(parameters).queryOne()
+ GenericValue shoppingListItem = from('ShoppingListItem').where(parameters).queryOne()
shoppingListItem.remove()
updateLastAdminModified(shoppingList, userLogin)
return success()
}
Review Comment:
Why moving this method?
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1186276446
SonarCloud Quality Gate failed. [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![9.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png '9.4%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [9.4% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1213191268
SonarCloud Quality Gate failed. [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![9.3%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png '9.3%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [9.3% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1381706476
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1367238143
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] danwatford commented on a diff in pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1089690105
##########
framework/webtools/groovyScripts/stats/StatsSinceStart.groovy:
##########
@@ -85,17 +60,23 @@ while (iterator.hasNext()) {
statsId = iterator.next()
Review Comment:
Can requestIdMap can be removed?
##########
framework/webtools/groovyScripts/service/JobDetails.groovy:
##########
@@ -22,15 +22,15 @@ import org.apache.ofbiz.entity.GenericValue
import org.apache.ofbiz.base.util.UtilGenerics
import org.apache.ofbiz.entity.serialize.XmlSerializer
-GenericValue job = ((Delegator)delegator).findOne("JobSandbox", [jobId:parameters.jobId], false)
+GenericValue job = ((Delegator) delegator).findOne('JobSandbox', [jobId: parameters.jobId], false)
context.job = job
if (job) {
- GenericValue runtimeData = job.getRelatedOne("RuntimeData", false)
+ GenericValue runtimeData = job.getRelatedOne('RuntimeData', false)
if (runtimeData) {
- runtimeInfoMap = UtilGenerics.checkMap(XmlSerializer.deserialize(runtimeData.getString("runtimeInfo"), delegator), String.class, Object.class)
+ runtimeInfoMap = UtilGenerics.checkMap(XmlSerializer.deserialize(runtimeData.getString('runtimeInfo'), delegator), String, Object)
Review Comment:
Is it okay to drop the .class field when referencing a type in Groovy? Anyone have a link to the relevant part of the language documentation?
##########
framework/webtools/groovyScripts/entity/XmlDsDump.groovy:
##########
@@ -17,151 +17,158 @@
* under the License.
*/
-import java.util.*
-import java.io.*
-import org.apache.ofbiz.base.util.*
-import org.apache.ofbiz.entity.model.*
-import org.apache.ofbiz.entity.util.*
-import org.apache.ofbiz.entity.transaction.*
-import org.apache.ofbiz.entity.condition.*
+import org.apache.ofbiz.base.util.Debug
+import org.apache.ofbiz.base.util.UtilFormatOut
+import org.apache.ofbiz.entity.condition.EntityComparisonOperator
+import org.apache.ofbiz.entity.condition.EntityCondition
+import org.apache.ofbiz.entity.condition.EntityJoinOperator
+import org.apache.ofbiz.entity.model.ModelViewEntity
+import org.apache.ofbiz.entity.transaction.TransactionUtil
+import org.apache.ofbiz.entity.util.EntityFindOptions
outpath = parameters.outpath
filename = parameters.filename
maxRecStr = parameters.maxrecords
entitySyncId = parameters.entitySyncId
passedEntityNames = null
-if (parameters.entityName) passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet
+if (parameters.entityName) {
+ passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet
+}
// get the max records per file setting and convert to a int
-maxRecordsPerFile = 0
-if (maxRecStr) {
- try {
- maxRecordsPerFile = Integer.parseInt(maxRecStr)
- }
- catch (Exception e) {
- }
-}
+int maxRecordsPerFile = maxRecStr ? (maxRecStr as int) : 0
Review Comment:
This will throw an exception if `maxRecStr` does not represent an integer.
```suggestion
int maxRecordsPerFile = maxRecStr && maxRecStr.isInteger() ? (maxRecStr as int) : 0
```
##########
applications/accounting/groovyScripts/invoice/EditInvoice.groovy:
##########
@@ -94,58 +91,57 @@ if (invoice) {
context.invoiceItems = invoiceItemsConv
- invoiceTotal = InvoiceWorker.getInvoiceTotal(invoice).multiply(conversionRate).setScale(decimals, rounding)
- invoiceNoTaxTotal = InvoiceWorker.getInvoiceNoTaxTotal(invoice).multiply(conversionRate).setScale(decimals, rounding)
+ invoiceTotal = InvoiceWorker.getInvoiceTotal(invoice) * conversionRate.setScale(decimals, rounding)
Review Comment:
This looks like a possible change in behaviour.
Before the change, _invoiceTotal_ and _conversionRate_ were multiplied together and then the result was scaled via setScale().
After the change, _conversionRate_ is scaled and then the result is multiplied with _invoiceTotal_.
A similar change of behaviour exists in the following line, too.
##########
applications/accounting/groovyScripts/invoice/PrintInvoices.groovy:
##########
@@ -26,39 +25,40 @@ import java.text.DateFormat
invoiceDetailList = []
invoiceIds.each { invoiceId ->
invoicesMap = [:]
- invoice = from("Invoice").where('invoiceId', invoiceId).queryOne()
+ invoice = from('Invoice').where('invoiceId', invoiceId).queryOne()
invoicesMap.invoice = invoice
-
- currency = parameters.currency // allow the display of the invoice in the original currency, the default is to display the invoice in the default currency
- BigDecimal conversionRate = new BigDecimal("1")
+
+ currency = parameters.currency // allow the display of the invoice in the original currency,
+ // the default is to display the invoice in the default currency
+ BigDecimal conversionRate = new BigDecimal('1')
ZERO = BigDecimal.ZERO
- decimals = UtilNumber.getBigDecimalScale("invoice.decimals")
- rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding")
-
+ decimals = UtilNumber.getBigDecimalScale('invoice.decimals')
+ rounding = UtilNumber.getBigDecimalRoundingMode('invoice.rounding')
+
if (invoice) {
- if (currency && !invoice.getString("currencyUomId").equals(currency)) {
+ if (currency && invoice.getString('currencyUomId') != currency) {
conversionRate = InvoiceWorker.getInvoiceCurrencyConversionRate(invoice)
invoice.currencyUomId = currency
- invoice.invoiceMessage = " converted from original with a rate of: " + conversionRate.setScale(8, rounding)
+ invoice.invoiceMessage = ' converted from original with a rate of: ' + conversionRate.setScale(8, rounding)
}
-
- invoiceItems = invoice.getRelated("InvoiceItem", null, ["invoiceItemSeqId"], false)
+
+ invoiceItems = invoice.getRelated('InvoiceItem', null, ['invoiceItemSeqId'], false)
invoiceItemsConv = []
invoiceItems.each { invoiceItem ->
- if (invoiceItem.amount) {
- invoiceItem.amount = invoiceItem.getBigDecimal("amount").multiply(conversionRate).setScale(decimals, rounding)
- invoiceItemsConv.add(invoiceItem)
- }
+ if (invoiceItem.amount) {
+ invoiceItem.amount = invoiceItem.getBigDecimal('amount') * conversionRate.setScale(decimals, rounding)
+ invoiceItemsConv.add(invoiceItem)
+ }
}
-
+
invoicesMap.invoiceItems = invoiceItemsConv
-
- invoiceTotal = InvoiceWorker.getInvoiceTotal(invoice).multiply(conversionRate).setScale(decimals, rounding)
- invoiceNoTaxTotal = InvoiceWorker.getInvoiceNoTaxTotal(invoice).multiply(conversionRate).setScale(decimals, rounding)
+
+ invoiceTotal = InvoiceWorker.getInvoiceTotal(invoice) * conversionRate.setScale(decimals, rounding)
Review Comment:
Behaviour change: scaling should be applied to multiplication result
##########
applications/accounting/groovyScripts/invoice/PrintInvoices.groovy:
##########
@@ -26,39 +25,40 @@ import java.text.DateFormat
invoiceDetailList = []
invoiceIds.each { invoiceId ->
invoicesMap = [:]
- invoice = from("Invoice").where('invoiceId', invoiceId).queryOne()
+ invoice = from('Invoice').where('invoiceId', invoiceId).queryOne()
invoicesMap.invoice = invoice
-
- currency = parameters.currency // allow the display of the invoice in the original currency, the default is to display the invoice in the default currency
- BigDecimal conversionRate = new BigDecimal("1")
+
+ currency = parameters.currency // allow the display of the invoice in the original currency,
+ // the default is to display the invoice in the default currency
+ BigDecimal conversionRate = new BigDecimal('1')
ZERO = BigDecimal.ZERO
- decimals = UtilNumber.getBigDecimalScale("invoice.decimals")
- rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding")
-
+ decimals = UtilNumber.getBigDecimalScale('invoice.decimals')
+ rounding = UtilNumber.getBigDecimalRoundingMode('invoice.rounding')
+
if (invoice) {
- if (currency && !invoice.getString("currencyUomId").equals(currency)) {
+ if (currency && invoice.getString('currencyUomId') != currency) {
conversionRate = InvoiceWorker.getInvoiceCurrencyConversionRate(invoice)
invoice.currencyUomId = currency
- invoice.invoiceMessage = " converted from original with a rate of: " + conversionRate.setScale(8, rounding)
+ invoice.invoiceMessage = ' converted from original with a rate of: ' + conversionRate.setScale(8, rounding)
}
-
- invoiceItems = invoice.getRelated("InvoiceItem", null, ["invoiceItemSeqId"], false)
+
+ invoiceItems = invoice.getRelated('InvoiceItem', null, ['invoiceItemSeqId'], false)
invoiceItemsConv = []
invoiceItems.each { invoiceItem ->
- if (invoiceItem.amount) {
- invoiceItem.amount = invoiceItem.getBigDecimal("amount").multiply(conversionRate).setScale(decimals, rounding)
- invoiceItemsConv.add(invoiceItem)
- }
+ if (invoiceItem.amount) {
+ invoiceItem.amount = invoiceItem.getBigDecimal('amount') * conversionRate.setScale(decimals, rounding)
Review Comment:
Behaviour change: conversionRate is being scaled before it is multipled by amount. Scaling should be applied after the multiplication.
##########
applications/accounting/groovyScripts/invoice/PrintInvoices.groovy:
##########
@@ -26,39 +25,40 @@ import java.text.DateFormat
invoiceDetailList = []
invoiceIds.each { invoiceId ->
invoicesMap = [:]
- invoice = from("Invoice").where('invoiceId', invoiceId).queryOne()
+ invoice = from('Invoice').where('invoiceId', invoiceId).queryOne()
invoicesMap.invoice = invoice
-
- currency = parameters.currency // allow the display of the invoice in the original currency, the default is to display the invoice in the default currency
- BigDecimal conversionRate = new BigDecimal("1")
+
+ currency = parameters.currency // allow the display of the invoice in the original currency,
+ // the default is to display the invoice in the default currency
+ BigDecimal conversionRate = new BigDecimal('1')
ZERO = BigDecimal.ZERO
- decimals = UtilNumber.getBigDecimalScale("invoice.decimals")
- rounding = UtilNumber.getBigDecimalRoundingMode("invoice.rounding")
-
+ decimals = UtilNumber.getBigDecimalScale('invoice.decimals')
+ rounding = UtilNumber.getBigDecimalRoundingMode('invoice.rounding')
+
if (invoice) {
- if (currency && !invoice.getString("currencyUomId").equals(currency)) {
+ if (currency && invoice.getString('currencyUomId') != currency) {
conversionRate = InvoiceWorker.getInvoiceCurrencyConversionRate(invoice)
invoice.currencyUomId = currency
- invoice.invoiceMessage = " converted from original with a rate of: " + conversionRate.setScale(8, rounding)
+ invoice.invoiceMessage = ' converted from original with a rate of: ' + conversionRate.setScale(8, rounding)
}
-
- invoiceItems = invoice.getRelated("InvoiceItem", null, ["invoiceItemSeqId"], false)
+
+ invoiceItems = invoice.getRelated('InvoiceItem', null, ['invoiceItemSeqId'], false)
invoiceItemsConv = []
invoiceItems.each { invoiceItem ->
- if (invoiceItem.amount) {
- invoiceItem.amount = invoiceItem.getBigDecimal("amount").multiply(conversionRate).setScale(decimals, rounding)
- invoiceItemsConv.add(invoiceItem)
- }
+ if (invoiceItem.amount) {
+ invoiceItem.amount = invoiceItem.getBigDecimal('amount') * conversionRate.setScale(decimals, rounding)
+ invoiceItemsConv.add(invoiceItem)
+ }
}
-
+
invoicesMap.invoiceItems = invoiceItemsConv
-
- invoiceTotal = InvoiceWorker.getInvoiceTotal(invoice).multiply(conversionRate).setScale(decimals, rounding)
- invoiceNoTaxTotal = InvoiceWorker.getInvoiceNoTaxTotal(invoice).multiply(conversionRate).setScale(decimals, rounding)
+
+ invoiceTotal = InvoiceWorker.getInvoiceTotal(invoice) * conversionRate.setScale(decimals, rounding)
+ invoiceNoTaxTotal = InvoiceWorker.getInvoiceNoTaxTotal(invoice) * conversionRate.setScale(decimals, rounding)
Review Comment:
Behaviour change: scaling should be applied to multiplication result
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1422564098
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1132340707
##########
applications/accounting/groovyScripts/reports/CostCenters.groovy:
##########
@@ -26,50 +25,49 @@ import org.apache.ofbiz.entity.condition.EntityOperator
if (!fromDate) {
return
}
-if (!thruDate) {
- thruDate = UtilDateTime.nowTimestamp()
-}
-if (!parameters.glFiscalTypeId) {
- parameters.glFiscalTypeId = "ACTUAL"
-}
+thruDate = thruDate ?: UtilDateTime.nowTimestamp()
+parameters.glFiscalTypeId = parameters.glFiscalTypeId ?: 'ACTUAL'
// POSTED
// Posted transactions totals and grand totals
postedTotalDebit = BigDecimal.ZERO
postedTotalCredit = BigDecimal.ZERO
andExprs = []
-andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds))
-andExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y"))
-andExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, parameters.glFiscalTypeId))
-andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
-andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
+andExprs.add(EntityCondition.makeCondition('organizationPartyId', EntityOperator.IN, partyIds))
+andExprs.add(EntityCondition.makeCondition('isPosted', EntityOperator.EQUALS, 'Y'))
+andExprs.add(EntityCondition.makeCondition('glFiscalTypeId', EntityOperator.EQUALS, parameters.glFiscalTypeId))
+andExprs.add(EntityCondition.makeCondition('transactionDate', EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
+andExprs.add(EntityCondition.makeCondition('transactionDate', EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
andCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND)
-List postedTransactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(andCond).orderBy("glAccountId").queryList()
+List postedTransactionTotals = select('glAccountId', 'accountName', 'accountCode', 'debitCreditFlag', 'amount')
+ .from('AcctgTransEntrySums').where(andCond).orderBy('glAccountId').queryList()
if (postedTransactionTotals) {
- glAccountCategories = from("GlAccountCategory").where("glAccountCategoryTypeId", "COST_CENTER").orderBy("glAccountCategoryId").queryList()
+ glAccountCategories = from('GlAccountCategory').where('glAccountCategoryTypeId', 'COST_CENTER').orderBy('glAccountCategoryId').queryList()
context.glAccountCategories = glAccountCategories
Map postedTransactionTotalsMap = [:]
postedTransactionTotals.each { postedTransactionTotal ->
Map accountMap = (Map)postedTransactionTotalsMap.get(postedTransactionTotal.glAccountId)
if (!accountMap) {
accountMap = UtilMisc.makeMapWritable(postedTransactionTotal)
- accountMap.put("D", BigDecimal.ZERO)
- accountMap.put("C", BigDecimal.ZERO)
+ accountMap.put('D', BigDecimal.ZERO)
+ accountMap.put('C', BigDecimal.ZERO)
}
UtilMisc.addToBigDecimalInMap(accountMap, postedTransactionTotal.debitCreditFlag, postedTransactionTotal.amount)
postedTransactionTotalsMap.put(postedTransactionTotal.glAccountId, accountMap)
- BigDecimal debitAmount = (BigDecimal)accountMap.get("D")
- BigDecimal creditAmount = (BigDecimal)accountMap.get("C")
+ BigDecimal debitAmount = (BigDecimal)accountMap.get('D')
+ BigDecimal creditAmount = (BigDecimal)accountMap.get('C')
BigDecimal balance = debitAmount.subtract(creditAmount)
- accountMap.put("balance", balance)
+ accountMap.put('balance', balance)
glAccountCategories.each { glAccountCategory ->
- glAccountCategoryMember = from("GlAccountCategoryMember").where("glAccountCategoryId", glAccountCategory.glAccountCategoryId, "glAccountId", postedTransactionTotal.glAccountId).orderBy("glAccountCategoryId").filterByDate().queryFirst()
+ glAccountCategoryMember = from('GlAccountCategoryMember')
+ .where('glAccountCategoryId', glAccountCategory.glAccountCategoryId, 'glAccountId', postedTransactionTotal.glAccountId)
+ .orderBy('glAccountCategoryId').filterByDate().queryFirst()
if (glAccountCategoryMember) {
BigDecimal glAccountCategorySharePercentage = glAccountCategoryMember.amountPercentage
if (glAccountCategorySharePercentage && glAccountCategorySharePercentage != BigDecimal.ZERO ) {
Review Comment:
Hello @JacquesLeRoux , no, it is not needed, but it is not concerned by a codenarc rule :).
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1089174447
##########
framework/webtools/src/main/groovy/org/apache/ofbiz/webtools/log/FetchLogs.groovy:
##########
@@ -16,23 +16,22 @@
* specific language governing permissions and limitations
Review Comment:
Reviewed
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1132150321
##########
applications/accounting/groovyScripts/reports/CostCenters.groovy:
##########
@@ -26,50 +25,49 @@ import org.apache.ofbiz.entity.condition.EntityOperator
if (!fromDate) {
return
}
-if (!thruDate) {
- thruDate = UtilDateTime.nowTimestamp()
-}
-if (!parameters.glFiscalTypeId) {
- parameters.glFiscalTypeId = "ACTUAL"
-}
+thruDate = thruDate ?: UtilDateTime.nowTimestamp()
+parameters.glFiscalTypeId = parameters.glFiscalTypeId ?: 'ACTUAL'
// POSTED
// Posted transactions totals and grand totals
postedTotalDebit = BigDecimal.ZERO
postedTotalCredit = BigDecimal.ZERO
andExprs = []
-andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds))
-andExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y"))
-andExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, parameters.glFiscalTypeId))
-andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
-andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
+andExprs.add(EntityCondition.makeCondition('organizationPartyId', EntityOperator.IN, partyIds))
+andExprs.add(EntityCondition.makeCondition('isPosted', EntityOperator.EQUALS, 'Y'))
+andExprs.add(EntityCondition.makeCondition('glFiscalTypeId', EntityOperator.EQUALS, parameters.glFiscalTypeId))
+andExprs.add(EntityCondition.makeCondition('transactionDate', EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
+andExprs.add(EntityCondition.makeCondition('transactionDate', EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
andCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND)
-List postedTransactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(andCond).orderBy("glAccountId").queryList()
+List postedTransactionTotals = select('glAccountId', 'accountName', 'accountCode', 'debitCreditFlag', 'amount')
+ .from('AcctgTransEntrySums').where(andCond).orderBy('glAccountId').queryList()
if (postedTransactionTotals) {
- glAccountCategories = from("GlAccountCategory").where("glAccountCategoryTypeId", "COST_CENTER").orderBy("glAccountCategoryId").queryList()
+ glAccountCategories = from('GlAccountCategory').where('glAccountCategoryTypeId', 'COST_CENTER').orderBy('glAccountCategoryId').queryList()
context.glAccountCategories = glAccountCategories
Map postedTransactionTotalsMap = [:]
postedTransactionTotals.each { postedTransactionTotal ->
Map accountMap = (Map)postedTransactionTotalsMap.get(postedTransactionTotal.glAccountId)
if (!accountMap) {
accountMap = UtilMisc.makeMapWritable(postedTransactionTotal)
- accountMap.put("D", BigDecimal.ZERO)
- accountMap.put("C", BigDecimal.ZERO)
+ accountMap.put('D', BigDecimal.ZERO)
+ accountMap.put('C', BigDecimal.ZERO)
}
UtilMisc.addToBigDecimalInMap(accountMap, postedTransactionTotal.debitCreditFlag, postedTransactionTotal.amount)
postedTransactionTotalsMap.put(postedTransactionTotal.glAccountId, accountMap)
- BigDecimal debitAmount = (BigDecimal)accountMap.get("D")
- BigDecimal creditAmount = (BigDecimal)accountMap.get("C")
+ BigDecimal debitAmount = (BigDecimal)accountMap.get('D')
+ BigDecimal creditAmount = (BigDecimal)accountMap.get('C')
BigDecimal balance = debitAmount.subtract(creditAmount)
- accountMap.put("balance", balance)
+ accountMap.put('balance', balance)
glAccountCategories.each { glAccountCategory ->
- glAccountCategoryMember = from("GlAccountCategoryMember").where("glAccountCategoryId", glAccountCategory.glAccountCategoryId, "glAccountId", postedTransactionTotal.glAccountId).orderBy("glAccountCategoryId").filterByDate().queryFirst()
+ glAccountCategoryMember = from('GlAccountCategoryMember')
+ .where('glAccountCategoryId', glAccountCategory.glAccountCategoryId, 'glAccountId', postedTransactionTotal.glAccountId)
+ .orderBy('glAccountCategoryId').filterByDate().queryFirst()
if (glAccountCategoryMember) {
BigDecimal glAccountCategorySharePercentage = glAccountCategoryMember.amountPercentage
if (glAccountCategorySharePercentage && glAccountCategorySharePercentage != BigDecimal.ZERO ) {
Review Comment:
Is BigDecimal.ZERO needed here ?
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1149422868
##########
applications/order/groovyScripts/shoppinglist/ShoppingListServices.groovy:
##########
@@ -131,39 +123,30 @@ def updateShoppingListItem() {
/**
* Remove a ShoppingListItem
- * @return
*/
-def removeShoppingListItem() {
- GenericValue shoppingList = from("ShoppingList").where(parameters).queryOne()
- GenericValue shoppingListItem = from("ShoppingListItem").where(parameters).queryOne()
+Map removeShoppingListItem() {
+ GenericValue shoppingList = from('ShoppingList').where(parameters).queryOne()
+ GenericValue shoppingListItem = from('ShoppingListItem').where(parameters).queryOne()
shoppingListItem.remove()
updateLastAdminModified(shoppingList, userLogin)
return success()
}
Review Comment:
oh, indeed i missread, the if was inverted to respect InvertedIfElse rule : An inverted if-else statement is one in which there is a single if statement with a single else branch and the boolean test of the if is negated. For instance if (!x) false else true. It is usually clearer to write this as if (x) true else false.
The method was not moved since it is still in the `if (!shoppingListItems) {` block.
--
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
Re: [GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by Jacques Le Roux <ja...@les7arts.com>.
Comment deleted, I should have specified the method name. It's updateLastAdminModified pushed to bottom
Le 24/03/2023 à 18:20, JacquesLeRoux (via GitHub) a écrit :
> JacquesLeRoux commented on code in PR #517:
> URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147868955
>
>
> ##########
> applications/order/groovyScripts/shoppinglist/ShoppingListServices.groovy:
> ##########
> @@ -131,39 +123,30 @@ def updateShoppingListItem() {
>
> /**
> * Remove a ShoppingListItem
> - * @return
> */
> -def removeShoppingListItem() {
> - GenericValue shoppingList = from("ShoppingList").where(parameters).queryOne()
> - GenericValue shoppingListItem = from("ShoppingListItem").where(parameters).queryOne()
> +Map removeShoppingListItem() {
> + GenericValue shoppingList = from('ShoppingList').where(parameters).queryOne()
> + GenericValue shoppingListItem = from('ShoppingListItem').where(parameters).queryOne()
> shoppingListItem.remove()
>
> updateLastAdminModified(shoppingList, userLogin)
> return success()
> }
>
>
> Review Comment:
> Wait, I think I mixed with another file, checking....
>
>
>
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147868955
##########
applications/order/groovyScripts/shoppinglist/ShoppingListServices.groovy:
##########
@@ -131,39 +123,30 @@ def updateShoppingListItem() {
/**
* Remove a ShoppingListItem
- * @return
*/
-def removeShoppingListItem() {
- GenericValue shoppingList = from("ShoppingList").where(parameters).queryOne()
- GenericValue shoppingListItem = from("ShoppingListItem").where(parameters).queryOne()
+Map removeShoppingListItem() {
+ GenericValue shoppingList = from('ShoppingList').where(parameters).queryOne()
+ GenericValue shoppingListItem = from('ShoppingListItem').where(parameters).queryOne()
shoppingListItem.remove()
updateLastAdminModified(shoppingList, userLogin)
return success()
}
Review Comment:
Wait, I think I mixed with another file, checking....
--
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
[GitHub] [ofbiz-framework] danwatford commented on pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1497396333
@nmalin - are you happy with the response to your questions in the review tracker, here - https://cwiki.apache.org/confluence/display/OFBIZ/Codenarc+integration+review+tracker ?
If so, please could you mark the review results for MarketingCampaignReport.groovy, TrackingCodeReport.groovy and LookupBulkAddProducts.groovy as passed.
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1499010022
If we suppose it's (only) about integration (GH actions and BB) we could not load the plugins when checking?
--
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
[GitHub] [ofbiz-framework] gilPts commented on pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1500391216
I just pushed https://github.com/apache/ofbiz-framework/pull/618 for the last reviews.
That should be faster than the first one :o)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1182554450
SonarCloud Quality Gate failed. [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![9.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png '9.4%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [9.4% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1367944599
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1367957133
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] danwatford commented on a diff in pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1088062833
##########
applications/accounting/groovyScripts/admin/ListInvoiceItemTypesGlAccount.groovy:
##########
@@ -30,25 +30,25 @@ invoiceItemTypes = from('InvoiceItemType').where(exprBldr.LIKE(invoiceItemTypeId
context.invoiceItemTypes = invoiceItemTypes.collect { invoiceItemType ->
defaultAccount = true
glAccount = null
- invoiceItemTypeOrgs = invoiceItemType.getRelated("InvoiceItemTypeGlAccount", [organizationPartyId : organizationPartyId], null, false)
+ invoiceItemTypeOrgs = invoiceItemType.getRelated('InvoiceItemTypeGlAccount', [organizationPartyId: organizationPartyId], null, false)
overrideGlAccountId = null
if (invoiceItemTypeOrgs) {
invoiceItemTypeOrg = invoiceItemTypeOrgs[0]
overrideGlAccountId = invoiceItemTypeOrg.glAccountId
- glAccounts = invoiceItemTypeOrg.getRelated("GlAccount", null, null, false)
+ glAccounts = invoiceItemTypeOrg.getRelated('GlAccount', null, null, false)
if (glAccounts) {
glAccount = glAccounts[0]
defaultAccount = false
}
} else {
- glAccount = invoiceItemType.getRelatedOne("DefaultGlAccount", false)
+ glAccount = invoiceItemType.getRelatedOne('DefaultGlAccount', false)
}
- return [invoiceItemTypeId : invoiceItemType.invoiceItemTypeId,
- description : invoiceItemType.description,
- defaultGlAccountId : invoiceItemType.defaultGlAccountId,
- overrideGlAccountId : overrideGlAccountId,
- defaultAccount : defaultAccount,
- activeGlDescription : glAccount?.accountName]
+ return [invoiceItemTypeId: invoiceItemType.invoiceItemTypeId,
+ description: invoiceItemType.description,
+ defaultGlAccountId: invoiceItemType.defaultGlAccountId,
+ overrideGlAccountId: overrideGlAccountId,
+ defaultAccount: defaultAccount,
+ activeGlDescriptio: glAccount?.accountName]
Review Comment:
Typo in activeGlDescriptio?
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1089173659
##########
settings.gradle:
##########
@@ -20,8 +20,8 @@
apply from: 'common.gradle'
Review Comment:
Reviewed
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1100076320
##########
framework/webtools/groovyScripts/stats/StatsSinceStart.groovy:
##########
@@ -85,17 +60,23 @@ while (iterator.hasNext()) {
statsId = iterator.next()
Review Comment:
Yes it can, how do we procede, i don't mind doing the fix, if you prefer you can also do it !
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1453606683
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1464030542
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147870040
##########
applications/order/groovyScripts/shoppinglist/ShoppingListServices.groovy:
##########
@@ -320,13 +299,20 @@ def addSuggestionsToShoppingList() {
}
private List<GenericValue> linkProductToShoppingList(String productId, String shoppingListId) {
- from("ProductAssoc")
- .where(productId: productId,
- productAssocTypeId: "PRODUCT_COMPLEMENT")
- .filterByDate()
- .queryList().each {
- run service: "addDistinctShoppingListItem", with: [productId : it.productIdTo,
- shoppingListId: shoppingListId,
- quantity : (BigDecimal) 1]
+ from('ProductAssoc')
+ .where(productId: productId,
+ productAssocTypeId: 'PRODUCT_COMPLEMENT')
+ .filterByDate()
+ .queryList().each {
+ run service: 'addDistinctShoppingListItem', with: [productId: it.productIdTo,
+ shoppingListId: shoppingListId,
+ quantity: (BigDecimal) 1]
+ }
+}
+
+private void updateLastAdminModified(GenericValue shoppingList, GenericValue userLogin) {
Review Comment:
Why moving updateLastAdminModified?
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1149451262
##########
applications/order/groovyScripts/shoppinglist/ShoppingListServices.groovy:
##########
@@ -131,39 +123,30 @@ def updateShoppingListItem() {
/**
* Remove a ShoppingListItem
- * @return
*/
-def removeShoppingListItem() {
- GenericValue shoppingList = from("ShoppingList").where(parameters).queryOne()
- GenericValue shoppingListItem = from("ShoppingListItem").where(parameters).queryOne()
+Map removeShoppingListItem() {
+ GenericValue shoppingList = from('ShoppingList').where(parameters).queryOne()
+ GenericValue shoppingListItem = from('ShoppingListItem').where(parameters).queryOne()
shoppingListItem.remove()
updateLastAdminModified(shoppingList, userLogin)
return success()
}
Review Comment:
I got that (it's very common in your changes, great), I was just speaking about the position of its definition.
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1158325735
##########
framework/webtools/groovyScripts/entity/XmlDsDump.groovy:
##########
@@ -17,151 +17,158 @@
* under the License.
*/
-import java.util.*
-import java.io.*
-import org.apache.ofbiz.base.util.*
-import org.apache.ofbiz.entity.model.*
-import org.apache.ofbiz.entity.util.*
-import org.apache.ofbiz.entity.transaction.*
-import org.apache.ofbiz.entity.condition.*
+import org.apache.ofbiz.base.util.Debug
+import org.apache.ofbiz.base.util.UtilFormatOut
+import org.apache.ofbiz.entity.condition.EntityComparisonOperator
+import org.apache.ofbiz.entity.condition.EntityCondition
+import org.apache.ofbiz.entity.condition.EntityJoinOperator
+import org.apache.ofbiz.entity.model.ModelViewEntity
+import org.apache.ofbiz.entity.transaction.TransactionUtil
+import org.apache.ofbiz.entity.util.EntityFindOptions
outpath = parameters.outpath
filename = parameters.filename
maxRecStr = parameters.maxrecords
entitySyncId = parameters.entitySyncId
passedEntityNames = null
-if (parameters.entityName) passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet
+if (parameters.entityName) {
+ passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet
+}
// get the max records per file setting and convert to a int
-maxRecordsPerFile = 0
-if (maxRecStr) {
- try {
- maxRecordsPerFile = Integer.parseInt(maxRecStr)
- }
- catch (Exception e) {
- }
-}
+int maxRecordsPerFile = maxRecStr ? (maxRecStr as int) : 0
Review Comment:
it was in https://github.com/apache/ofbiz-framework/pull/517/commits/f58a85cb16f85bf5ceab0b9643abc365f03189c2
--
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
[GitHub] [ofbiz-framework] danwatford commented on pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1497399137
@JacquesLeRoux , in the tracker (https://cwiki.apache.org/confluence/display/OFBIZ/Codenarc+integration+review+tracker) you mentioned work was needed.
What sort of changes are needed, or was the WORK_NEEDED review result put there to highlight a possible conflict?
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1367834383
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] danwatford commented on pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1499142511
> I was actually wondering if Codenarc was providing threshold, according to* it is.
>
> * https://stackoverflow.com/questions/27949345/codenarc-priority-meanings
The Gradle CodeNarc plugin has similar settings to set thresholds:
https://docs.gradle.org/current/dsl/org.gradle.api.plugins.quality.CodeNarcExtension.html
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1186320312
SonarCloud Quality Gate failed. [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![9.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png '9.4%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [9.4% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1100075028
##########
framework/webtools/groovyScripts/service/JobDetails.groovy:
##########
@@ -22,15 +22,15 @@ import org.apache.ofbiz.entity.GenericValue
import org.apache.ofbiz.base.util.UtilGenerics
import org.apache.ofbiz.entity.serialize.XmlSerializer
-GenericValue job = ((Delegator)delegator).findOne("JobSandbox", [jobId:parameters.jobId], false)
+GenericValue job = ((Delegator) delegator).findOne('JobSandbox', [jobId: parameters.jobId], false)
context.job = job
if (job) {
- GenericValue runtimeData = job.getRelatedOne("RuntimeData", false)
+ GenericValue runtimeData = job.getRelatedOne('RuntimeData', false)
if (runtimeData) {
- runtimeInfoMap = UtilGenerics.checkMap(XmlSerializer.deserialize(runtimeData.getString("runtimeInfo"), delegator), String.class, Object.class)
+ runtimeInfoMap = UtilGenerics.checkMap(XmlSerializer.deserialize(runtimeData.getString('runtimeInfo'), delegator), String, Object)
Review Comment:
Hello UnnecessaryDotClass is a rule from codenarc, applying that the .class suffix is not needed in Groovy
https://groovy-lang.org/style-guide.html#_classes_as_first_class_citizens
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1100087132
##########
applications/accounting/groovyScripts/invoice/EditInvoice.groovy:
##########
@@ -94,58 +91,57 @@ if (invoice) {
context.invoiceItems = invoiceItemsConv
- invoiceTotal = InvoiceWorker.getInvoiceTotal(invoice).multiply(conversionRate).setScale(decimals, rounding)
- invoiceNoTaxTotal = InvoiceWorker.getInvoiceNoTaxTotal(invoice).multiply(conversionRate).setScale(decimals, rounding)
+ invoiceTotal = InvoiceWorker.getInvoiceTotal(invoice) * conversionRate.setScale(decimals, rounding)
Review Comment:
Nice catch, tested and you are right, if that's ok with you i will go through all of this commit code to search for similar issue, and fix that.
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1382031410
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1367855137
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1367955900
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1367923844
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1367949011
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1367936717
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1242136487
SonarCloud Quality Gate failed. [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![9.3%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png '9.3%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [9.3% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] nmalin commented on a diff in pull request #517: Codenarc integration
Posted by "nmalin (via GitHub)" <gi...@apache.org>.
nmalin commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1132427286
##########
applications/marketing/groovyScripts/marketing/reports/TrackingCodeReport.groovy:
##########
@@ -27,21 +27,22 @@ visitConditionList = [] as LinkedList
orderConditionList = [] as LinkedList
if (fromDate) {
- visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
- orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
+ visitConditionList.add(EntityCondition.makeCondition('fromDate', EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
+ orderConditionList.add(EntityCondition.makeCondition('orderDate', EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
}
if (thruDate) {
- visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
- orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
+ visitConditionList.add(EntityCondition.makeCondition('fromDate', EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
+ orderConditionList.add(EntityCondition.makeCondition('orderDate', EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
}
if (trackingCodeId) {
- visitConditionList.add(EntityCondition.makeCondition("trackingCodeId", EntityOperator.EQUALS, trackingCodeId))
- orderConditionList.add(EntityCondition.makeCondition("trackingCodeId", EntityOperator.EQUALS, trackingCodeId))
+ visitConditionList.add(EntityCondition.makeCondition('trackingCodeId', EntityOperator.EQUALS, trackingCodeId))
+ orderConditionList.add(EntityCondition.makeCondition('trackingCodeId', EntityOperator.EQUALS, trackingCodeId))
}
-visits = select("trackingCodeId", "visitId").from("TrackingCodeAndVisit").where(visitConditionList).orderBy("trackingCodeId").queryList()
-orders = select("trackingCodeId", "orderId", "grandTotal").from("TrackingCodeAndOrderHeader").where(orderConditionList).orderBy("trackingCodeId").queryList()
+visits = select('trackingCodeId', 'visitId').from('TrackingCodeAndVisit').where(visitConditionList).orderBy('trackingCodeId').queryList()
+orders = select('trackingCodeId', 'orderId', 'grandTotal')
+ .from('TrackingCodeAndOrderHeader').where(orderConditionList).orderBy('trackingCodeId').queryList()
Review Comment:
The reading can be improve to support the rule 'LineLength rule implementation' like the following :
```suggestion
visits = select('trackingCodeId', 'visitId')
.from('TrackingCodeAndVisit')
.where(visitConditionList)
.orderBy('trackingCodeId')
.queryList()
orders = select('trackingCodeId', 'orderId', 'grandTotal')
.from('TrackingCodeAndOrderHeader')
.where(orderConditionList)
.orderBy('trackingCodeId')
.queryList()
```
##########
applications/order/groovyScripts/entry/cart/LookupBulkAddSupplierProducts.groovy:
##########
@@ -62,22 +60,23 @@ conditionList = []
if (productId) {
// make sure the look up is case insensitive
- conditionList.add(EntityCondition.makeCondition(EntityFunction.upper(EntityFieldValue.makeFieldValue("productId")),
- EntityOperator.LIKE, productId.toUpperCase() + "%"))
+ conditionList.add(EntityCondition.makeCondition(EntityFunction.upper(EntityFieldValue.makeFieldValue('productId')),
+ EntityOperator.LIKE, productId.toUpperCase() + '%'))
}
-if (!supplier) {
- supplierPartyId = shoppingCart.getOrderPartyId()
+if (supplier) {
+ supplierPartyId = supplier.getString('partyId')
} else {
- supplierPartyId = supplier.getString("partyId")
+ supplierPartyId = shoppingCart.getOrderPartyId()
Review Comment:
This catch by the rules **InvertedIfElse** rule can be also converted with the rule **CouldBeElvis** rule by :
```
supplierPartyId = supplier?.partyId ?: shoppingCart.getOrderPartyId()
```
##########
applications/marketing/groovyScripts/marketing/reports/MarketingCampaignReport.groovy:
##########
@@ -23,26 +23,28 @@ import org.apache.ofbiz.marketing.report.ReportHelper
//query for both number of visits and number of orders
-marketingCampaignId = request.getParameter("marketingCampaignId")
+marketingCampaignId = request.getParameter('marketingCampaignId')
visitConditionList = [] as LinkedList
orderConditionList = [] as LinkedList
if (fromDate) {
- visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
- orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
+ visitConditionList.add(EntityCondition.makeCondition('fromDate', EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
+ orderConditionList.add(EntityCondition.makeCondition('orderDate', EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
}
if (thruDate) {
- visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
- orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
+ visitConditionList.add(EntityCondition.makeCondition('fromDate', EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
+ orderConditionList.add(EntityCondition.makeCondition('orderDate', EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
}
if (marketingCampaignId) {
- visitConditionList.add(EntityCondition.makeCondition("marketingCampaignId", EntityOperator.EQUALS, marketingCampaignId))
- orderConditionList.add(EntityCondition.makeCondition("marketingCampaignId", EntityOperator.EQUALS, marketingCampaignId))
+ visitConditionList.add(EntityCondition.makeCondition('marketingCampaignId', EntityOperator.EQUALS, marketingCampaignId))
+ orderConditionList.add(EntityCondition.makeCondition('marketingCampaignId', EntityOperator.EQUALS, marketingCampaignId))
}
-visits = select("marketingCampaignId", "visitId").from("MarketingCampaignAndVisit").where(visitConditionList).orderBy("marketingCampaignId").queryList()
-orders = select("marketingCampaignId", "orderId", "grandTotal").from("MarketingCampaignAndOrderHeader").where(orderConditionList).orderBy("marketingCampaignId").queryList()
+visits = select('marketingCampaignId', 'visitId')
+ .from('MarketingCampaignAndVisit').where(visitConditionList).orderBy('marketingCampaignId').queryList()
+orders = select('marketingCampaignId', 'orderId', 'grandTotal')
+ .from('MarketingCampaignAndOrderHeader').where(orderConditionList).orderBy('marketingCampaignId').queryList()
Review Comment:
The reading can be improve to support the rule 'LineLength rule implementation' like the following :
```suggestion
visits = select('marketingCampaignId', 'visitId')
.from('MarketingCampaignAndVisit')
.where(visitConditionList)
.orderBy('marketingCampaignId')
.queryList()
orders = select('marketingCampaignId', 'orderId', 'grandTotal')
.from('MarketingCampaignAndOrderHeader')
.where(orderConditionList)
.orderBy('marketingCampaignId')
.queryList()
```
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1135791908
##########
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:
True, i will check that again soon, since i might have found out how to respect the codenarc rule behind.
--
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
Re: [GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by Jacques Le Roux <ja...@les7arts.com>.
I deleted this one
Le 21/03/2023 à 09:44, JacquesLeRoux (via GitHub) a écrit :
> JacquesLeRoux commented on code in PR #517:
> URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1143040049
>
>
> ##########
> applications/product/groovyScripts/facility/shipment/EditShipmentPlan.groovy:
> ##########
> @@ -19,21 +19,17 @@
>
> import org.apache.ofbiz.entity.condition.EntityCondition
>
> -shipmentId = request.getParameter("shipmentId")
> -orderId = request.getParameter("orderId")
> -shipGroupSeqId = request.getParameter("shipGroupSeqId")
> +shipmentId = request.getParameter('shipmentId') ?: context.shipmentId
>
> Review Comment:
> I guess that context is used there because there is an upstream reason?
>
>
>
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1143040049
##########
applications/product/groovyScripts/facility/shipment/EditShipmentPlan.groovy:
##########
@@ -19,21 +19,17 @@
import org.apache.ofbiz.entity.condition.EntityCondition
-shipmentId = request.getParameter("shipmentId")
-orderId = request.getParameter("orderId")
-shipGroupSeqId = request.getParameter("shipGroupSeqId")
+shipmentId = request.getParameter('shipmentId') ?: context.shipmentId
Review Comment:
I guess that context is used there because there is an upstream reason?
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1089170578
##########
applications/accounting/groovyScripts/admin/ListInvoiceItemTypesGlAccount.groovy:
##########
@@ -20,8 +20,8 @@
import org.apache.ofbiz.entity.condition.EntityConditionBuilder
Review Comment:
Reviewed by @danwatford
--
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
[GitHub] [ofbiz-framework] danwatford commented on a diff in pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1157555615
##########
framework/common/groovyScripts/CommonServices.groovy:
##########
@@ -350,107 +335,112 @@ def createKeywordThesaurus() {
/**
* Delete a complete Entry KeywordThesaurus
- * @return
*/
-def deleteKeywordThesaurus() {
- GenericValue newEntity = makeValue("KeywordThesaurus")
+Map deleteKeywordThesaurus() {
+ GenericValue newEntity = makeValue('KeywordThesaurus')
newEntity.enteredKeyword = parameters.enteredKeyword
if (parameters.alternateKeyword) {
newEntity.alternateKeyword = parameters.alternateKeyword
}
- delegator.removeByAnd("KeywordThesaurus", newEntity)
+ delegator.removeByAnd('KeywordThesaurus', newEntity)
return success()
}
-def createFuturePeriod() {
+Map createFuturePeriod() {
applTypes = []
grain = null
intermediate = null
- parties = from('PartyAcctgPreference').where('enableAccounting','Y').queryIterator()
- while (party = parties.next()){
+ parties = from('PartyAcctgPreference').where('enableAccounting', 'Y').queryIterator()
+ while (parties.hasNext()) {
+ party = parties.next()
parameters.organizationPartyId = party.partyId
createCustomTimePeriod = from('SystemProperty')
- .where('systemResourceId','general', 'systemPropertyId','CustomTimePeriod.create').queryOne()
- if ("Y".equals(createCustomTimePeriod.systemPropertyValue)) {
+ .where('systemResourceId', 'general', 'systemPropertyId', 'CustomTimePeriod.create').queryOne()
+ if (createCustomTimePeriod.systemPropertyValue == 'Y') {
// get list of CustomTypePeriod types
applTypes = from('SystemProperty')
- .where('systemResourceId','general', 'systemPropertyId','CustomTimePeriod.applType').queryOne()
- List types = Arrays.asList(applTypes.systemPropertyValue.split("\\s*,\\s*"))
- types.each{periodTypeId ->
- Calendar periodCal = Calendar.getInstance();
- systemPropertyId = "CustomTimePeriod." + periodTypeId + ".intermediate"
+ .where('systemResourceId', 'general', 'systemPropertyId', 'CustomTimePeriod.applType').queryOne()
+ List types = Arrays.asList(applTypes.systemPropertyValue.split('\\s*,\\s*'))
+ types.each { periodTypeId ->
+ Calendar periodCal = Calendar.getInstance()
+ systemPropertyId = 'CustomTimePeriod.' + periodTypeId + '.intermediate'
applTypeInter = from('SystemProperty')
- .where('systemResourceId','general', 'systemPropertyId',systemPropertyId).queryOne()
+ .where('systemResourceId', 'general', 'systemPropertyId', systemPropertyId).queryOne()
if (applTypeInter) {
intermediate = applTypeInter.systemPropertyValue
}
// get grain for application type
- systemPropertyId = "CustomTimePeriod." + periodTypeId + ".grain"
+ systemPropertyId = 'CustomTimePeriod.' + periodTypeId + '.grain'
applTypeGrain = from('SystemProperty')
- .where('systemResourceId','general', 'systemPropertyId',systemPropertyId).queryOne()
+ .where('systemResourceId', 'general', 'systemPropertyId', systemPropertyId).queryOne()
if (applTypeGrain) {
grain = applTypeGrain.systemPropertyValue
- if ("MONTH".equals(grain)) {
+ if (grain == 'MONTH') {
periodCal.add(Calendar.MONTH, 1)
- monthName = new SimpleDateFormat("MMM").format(periodCal.getTime())
+ monthName = new SimpleDateFormat('MMM', locale).format(periodCal.getTime())
Review Comment:
Specifying the locale is a behaviour change. I agree that the new code is probably the right thing to do, but I think the change should be made on a different PR with a corresponding bug report.
Perhaps I'm being too pedantic. What do others think?
--
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
[GitHub] [ofbiz-framework] danwatford commented on pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1497323596
@gilPts, It looks like we are getting close to completing this review :)
For the conflicting files, BalanceSheet.groovy has changed quite significantly since the CodeNarc Integration work began. Would it be worth copying the latest BalanceSheet.groovy from trunk and then applying the CodeNarc cleanup.
I'm not sure what would be the cleanest way to do this and keep git happy? Any Git experts on hand to comment?
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1158197368
##########
applications/product/groovyScripts/facility/facility/CountFacilityInventoryByProduct.groovy:
##########
@@ -55,165 +57,168 @@ 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)
+ prodView.with {
+ addMemberEntity('PRFA', 'ProductFacility')
+ addAlias('PRFA', 'productId', null, null, null, Boolean.TRUE, null)
+ addAlias('PRFA', 'minimumStock', null, null, null, Boolean.TRUE, null)
+ addAlias('PRFA', 'reorderQuantity', null, null, null, Boolean.TRUE, null)
+ addAlias('PRFA', 'daysToShip', null, null, null, Boolean.TRUE, null)
+ addAlias('PRFA', 'facilityId', null, null, null, Boolean.TRUE, null)
+
+ addMemberEntity('PROD', 'Product')
+ addViewLink('PROD', 'PRFA', Boolean.FALSE, ModelKeyMap.makeKeyMapList('productId'))
+ addAlias('PROD', 'internalName', null, null, null, Boolean.TRUE, null)
+ addAlias('PROD', 'isVirtual', null, null, null, Boolean.TRUE, null)
+ addAlias('PROD', 'salesDiscontinuationDate', null, null, null, Boolean.TRUE, null)
+ }
if (productTypeId) {
- prodView.addAlias("PROD", "productTypeId", null, null, null, Boolean.TRUE, null)
+ prodView.addAlias('PROD', 'productTypeId', null, null, null, Boolean.TRUE, null)
conditionMap.productTypeId = productTypeId
- searchParameterString = searchParameterString + "&productTypeId=" + productTypeId
+ searchParameterString = searchParameterString + '&productTypeId=' + productTypeId
}
- prodView.addMemberEntity("IITE", "InventoryItem")
- prodView.addViewLink("PRFA", "IITE", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId", "productId", "facilityId", "facilityId"))
- prodView.addAlias("IITE", "totalQuantityOnHandTotal", "quantityOnHandTotal", null, null, null, "sum")
- prodView.addAlias("IITE", "totalAvailableToPromiseTotal", "availableToPromiseTotal", null, null, null, "sum")
- qohDiffComplexAlias = new ComplexAlias("-")
- qohDiffComplexAlias.addComplexAliasMember(new ComplexAliasField("IITE", "quantityOnHandTotal", null, "sum"))
- qohDiffComplexAlias.addComplexAliasMember(new ComplexAliasField("PRFA", "minimumStock", null, null))
- prodView.addAlias(null, "offsetQOHQtyAvailable", null, null, null, null, null, qohDiffComplexAlias)
- atpDiffComplexAlias = new ComplexAlias("-")
- atpDiffComplexAlias.addComplexAliasMember(new ComplexAliasField("IITE", "availableToPromiseTotal", null, "sum"))
- atpDiffComplexAlias.addComplexAliasMember(new ComplexAliasField("PRFA", "minimumStock", null, null))
- prodView.addAlias(null, "offsetATPQtyAvailable", null, null, null, null, null, atpDiffComplexAlias)
+ prodView.addMemberEntity('IITE', 'InventoryItem')
+ prodView.addViewLink('PRFA', 'IITE', Boolean.FALSE, ModelKeyMap.makeKeyMapList('productId', 'productId', 'facilityId', 'facilityId'))
+ prodView.addAlias('IITE', 'totalQuantityOnHandTotal', 'quantityOnHandTotal', null, null, null, 'sum')
+ prodView.addAlias('IITE', 'totalAvailableToPromiseTotal', 'availableToPromiseTotal', null, null, null, 'sum')
+ qohDiffComplexAlias = new ComplexAlias('-')
+ qohDiffComplexAlias.addComplexAliasMember(new ComplexAliasField('IITE', 'quantityOnHandTotal', null, 'sum'))
+ qohDiffComplexAlias.addComplexAliasMember(new ComplexAliasField('PRFA', 'minimumStock', null, null))
+ prodView.addAlias(null, 'offsetQOHQtyAvailable', null, null, null, null, null, qohDiffComplexAlias)
+ atpDiffComplexAlias = new ComplexAlias('-')
+ atpDiffComplexAlias.addComplexAliasMember(new ComplexAliasField('IITE', 'availableToPromiseTotal', null, 'sum'))
+ atpDiffComplexAlias.addComplexAliasMember(new ComplexAliasField('PRFA', 'minimumStock', null, null))
+ prodView.addAlias(null, 'offsetATPQtyAvailable', null, null, null, null, null, atpDiffComplexAlias)
if (searchInProductCategoryId) {
- prodView.addMemberEntity("PRCA", "ProductCategoryMember")
- prodView.addViewLink("PRFA", "PRCA", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"))
- prodView.addAlias("PRCA", "productCategoryId", null, null, null, Boolean.TRUE, null)
+ prodView.addMemberEntity('PRCA', 'ProductCategoryMember')
+ prodView.addViewLink('PRFA', 'PRCA', Boolean.FALSE, ModelKeyMap.makeKeyMapList('productId'))
+ prodView.addAlias('PRCA', 'productCategoryId', null, null, null, Boolean.TRUE, null)
conditionMap.productCategoryId = searchInProductCategoryId
- searchParameterString = searchParameterString + "&searchInProductCategoryId=" + searchInProductCategoryId
+ searchParameterString = searchParameterString + '&searchInProductCategoryId=' + searchInProductCategoryId
}
if (productSupplierId) {
- prodView.addMemberEntity("SPPR", "SupplierProduct")
- prodView.addViewLink("PRFA", "SPPR", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"))
- prodView.addAlias("SPPR", "partyId", null, null, null, Boolean.TRUE, null)
+ prodView.addMemberEntity('SPPR', 'SupplierProduct')
+ prodView.addViewLink('PRFA', 'SPPR', Boolean.FALSE, ModelKeyMap.makeKeyMapList('productId'))
+ prodView.addAlias('SPPR', 'partyId', null, null, null, Boolean.TRUE, null)
conditionMap.partyId = productSupplierId
- searchParameterString = searchParameterString + "&productSupplierId=" + productSupplierId
+ searchParameterString = searchParameterString + '&productSupplierId=' + productSupplierId
}
// set distinct on so we only get one row per product
searchCondition = EntityCondition.makeCondition(conditionMap, EntityOperator.AND)
- notVirtualCondition = EntityCondition.makeCondition(EntityCondition.makeCondition("isVirtual", EntityOperator.EQUALS, null),
+ notVirtualCondition = EntityCondition.makeCondition(EntityCondition.makeCondition('isVirtual', EntityOperator.EQUALS, null),
EntityOperator.OR,
- EntityCondition.makeCondition("isVirtual", EntityOperator.NOT_EQUAL, "Y"))
+ EntityCondition.makeCondition('isVirtual', EntityOperator.NOT_EQUAL, 'Y'))
whereConditionsList = [searchCondition, notVirtualCondition]
// add the discontinuation date condition
if (productsSoldThruTimestamp) {
discontinuationDateCondition = EntityCondition.makeCondition(
[
- EntityCondition.makeCondition("salesDiscontinuationDate", EntityOperator.EQUALS, null),
- EntityCondition.makeCondition("salesDiscontinuationDate", EntityOperator.GREATER_THAN,productsSoldThruTimestamp)
+ EntityCondition.makeCondition('salesDiscontinuationDate', EntityOperator.EQUALS, null),
+ EntityCondition.makeCondition('salesDiscontinuationDate', EntityOperator.GREATER_THAN, productsSoldThruTimestamp)
],
EntityOperator.OR)
whereConditionsList.add(discontinuationDateCondition)
- searchParameterString = searchParameterString + "&productsSoldThruTimestamp=" + productsSoldThruTimestamp
+ searchParameterString = searchParameterString + '&productsSoldThruTimestamp=' + productsSoldThruTimestamp
}
// add search on internal name
if (internalName) {
- whereConditionsList.add(EntityCondition.makeCondition("internalName", EntityOperator.LIKE, "%" + internalName + "%"))
- searchParameterString = searchParameterString + "&internalName=" + internalName
+ whereConditionsList.add(EntityCondition.makeCondition('internalName', EntityOperator.LIKE, '%' + internalName + '%'))
+ searchParameterString = searchParameterString + '&internalName=' + internalName
}
// add search on productId
if (productId) {
- whereConditionsList.add(EntityCondition.makeCondition("productId", EntityOperator.LIKE, productId + "%"))
- searchParameterString = searchParameterString + "&productId=" + productId
+ whereConditionsList.add(EntityCondition.makeCondition('productId', EntityOperator.LIKE, productId + '%'))
+ searchParameterString = searchParameterString + '&productId=' + productId
}
orderBy = []
if (hasOffsetATP) {
- orderBy.add("offsetATPQtyAvailable")
+ orderBy.add('offsetATPQtyAvailable')
}
if (hasOffsetQOH) {
- orderBy.add("offsetQOHQtyAvailable")
+ orderBy.add('offsetQOHQtyAvailable')
}
- orderBy.add("productId")
+ orderBy.add('productId')
// If the user has specified a number of months over which to sum usage quantities, define the correct timestamp
checkTime = null
- monthsInPastLimitStr = request.getParameter("monthsInPastLimit")
+ monthsInPastLimitStr = request.getParameter('monthsInPastLimit')
if (monthsInPastLimitStr) {
try {
monthsInPastLimit = Integer.parseInt(monthsInPastLimitStr)
cal = UtilDateTime.toCalendar(null)
cal.add(Calendar.MONTH, 0 - monthsInPastLimit)
checkTime = UtilDateTime.toTimestamp(cal.getTime())
- searchParameterString += "&monthsInPastLimit=" + monthsInPastLimitStr
+ searchParameterString += '&monthsInPastLimit=' + monthsInPastLimitStr
} catch (Exception e) {
- logError(e, "Caught an exception : " + e.toString())
- request.setAttribute("_ERROR_MESSAGE", "An exception occured please check the log")
+ logError(e, 'Caught an exception : ' + e)
+ request.setAttribute('_ERROR_MESSAGE', 'An exception occured please check the log')
}
}
if (checkTime) {
-
// Construct a dynamic view entity to search against for sales usage quantities
- salesUsageViewEntity = new DynamicViewEntity()
- salesUsageViewEntity.addMemberEntity("OI", "OrderItem")
- salesUsageViewEntity.addMemberEntity("OH", "OrderHeader")
- salesUsageViewEntity.addMemberEntity("ItIss", "ItemIssuance")
- salesUsageViewEntity.addMemberEntity("InvIt", "InventoryItem")
- salesUsageViewEntity.addViewLink("OI", "OH", false, ModelKeyMap.makeKeyMapList("orderId"))
- salesUsageViewEntity.addViewLink("OI", "ItIss", false, ModelKeyMap.makeKeyMapList("orderId", "orderId", "orderItemSeqId", "orderItemSeqId"))
- salesUsageViewEntity.addViewLink("ItIss", "InvIt", false, ModelKeyMap.makeKeyMapList("inventoryItemId"))
- salesUsageViewEntity.addAlias("OI", "productId")
- salesUsageViewEntity.addAlias("OH", "statusId")
- salesUsageViewEntity.addAlias("OH", "orderTypeId")
- salesUsageViewEntity.addAlias("OH", "orderDate")
- salesUsageViewEntity.addAlias("ItIss", "inventoryItemId")
- salesUsageViewEntity.addAlias("ItIss", "quantity")
- salesUsageViewEntity.addAlias("InvIt", "facilityId")
+ salesUsageViewEntity = new DynamicViewEntity().with {
+ addMemberEntity('OI', 'OrderItem')
+ addMemberEntity('OH', 'OrderHeader')
+ addMemberEntity('ItIss', 'ItemIssuance')
+ addMemberEntity('InvIt', 'InventoryItem')
+ addViewLink('OI', 'OH', false, ModelKeyMap.makeKeyMapList('orderId'))
+ addViewLink('OI', 'ItIss', false, ModelKeyMap.makeKeyMapList('orderId', 'orderId', 'orderItemSeqId', 'orderItemSeqId'))
+ addViewLink('ItIss', 'InvIt', false, ModelKeyMap.makeKeyMapList('inventoryItemId'))
+ addAlias('OI', 'productId')
+ addAlias('OH', 'statusId')
+ addAlias('OH', 'orderTypeId')
+ addAlias('OH', 'orderDate')
+ addAlias('ItIss', 'inventoryItemId')
+ addAlias('ItIss', 'quantity')
+ addAlias('InvIt', 'facilityId')
+ }
Review Comment:
Done Thanks !
##########
applications/product/groovyScripts/facility/facility/CountFacilityInventoryByProduct.groovy:
##########
@@ -55,165 +57,168 @@ 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)
+ prodView.with {
+ addMemberEntity('PRFA', 'ProductFacility')
+ addAlias('PRFA', 'productId', null, null, null, Boolean.TRUE, null)
+ addAlias('PRFA', 'minimumStock', null, null, null, Boolean.TRUE, null)
+ addAlias('PRFA', 'reorderQuantity', null, null, null, Boolean.TRUE, null)
+ addAlias('PRFA', 'daysToShip', null, null, null, Boolean.TRUE, null)
+ addAlias('PRFA', 'facilityId', null, null, null, Boolean.TRUE, null)
+
+ addMemberEntity('PROD', 'Product')
+ addViewLink('PROD', 'PRFA', Boolean.FALSE, ModelKeyMap.makeKeyMapList('productId'))
+ addAlias('PROD', 'internalName', null, null, null, Boolean.TRUE, null)
+ addAlias('PROD', 'isVirtual', null, null, null, Boolean.TRUE, null)
+ addAlias('PROD', 'salesDiscontinuationDate', null, null, null, Boolean.TRUE, null)
+ }
if (productTypeId) {
- prodView.addAlias("PROD", "productTypeId", null, null, null, Boolean.TRUE, null)
+ prodView.addAlias('PROD', 'productTypeId', null, null, null, Boolean.TRUE, null)
conditionMap.productTypeId = productTypeId
- searchParameterString = searchParameterString + "&productTypeId=" + productTypeId
+ searchParameterString = searchParameterString + '&productTypeId=' + productTypeId
}
- prodView.addMemberEntity("IITE", "InventoryItem")
- prodView.addViewLink("PRFA", "IITE", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId", "productId", "facilityId", "facilityId"))
- prodView.addAlias("IITE", "totalQuantityOnHandTotal", "quantityOnHandTotal", null, null, null, "sum")
- prodView.addAlias("IITE", "totalAvailableToPromiseTotal", "availableToPromiseTotal", null, null, null, "sum")
- qohDiffComplexAlias = new ComplexAlias("-")
- qohDiffComplexAlias.addComplexAliasMember(new ComplexAliasField("IITE", "quantityOnHandTotal", null, "sum"))
- qohDiffComplexAlias.addComplexAliasMember(new ComplexAliasField("PRFA", "minimumStock", null, null))
- prodView.addAlias(null, "offsetQOHQtyAvailable", null, null, null, null, null, qohDiffComplexAlias)
- atpDiffComplexAlias = new ComplexAlias("-")
- atpDiffComplexAlias.addComplexAliasMember(new ComplexAliasField("IITE", "availableToPromiseTotal", null, "sum"))
- atpDiffComplexAlias.addComplexAliasMember(new ComplexAliasField("PRFA", "minimumStock", null, null))
- prodView.addAlias(null, "offsetATPQtyAvailable", null, null, null, null, null, atpDiffComplexAlias)
+ prodView.addMemberEntity('IITE', 'InventoryItem')
+ prodView.addViewLink('PRFA', 'IITE', Boolean.FALSE, ModelKeyMap.makeKeyMapList('productId', 'productId', 'facilityId', 'facilityId'))
+ prodView.addAlias('IITE', 'totalQuantityOnHandTotal', 'quantityOnHandTotal', null, null, null, 'sum')
+ prodView.addAlias('IITE', 'totalAvailableToPromiseTotal', 'availableToPromiseTotal', null, null, null, 'sum')
+ qohDiffComplexAlias = new ComplexAlias('-')
+ qohDiffComplexAlias.addComplexAliasMember(new ComplexAliasField('IITE', 'quantityOnHandTotal', null, 'sum'))
+ qohDiffComplexAlias.addComplexAliasMember(new ComplexAliasField('PRFA', 'minimumStock', null, null))
+ prodView.addAlias(null, 'offsetQOHQtyAvailable', null, null, null, null, null, qohDiffComplexAlias)
+ atpDiffComplexAlias = new ComplexAlias('-')
+ atpDiffComplexAlias.addComplexAliasMember(new ComplexAliasField('IITE', 'availableToPromiseTotal', null, 'sum'))
+ atpDiffComplexAlias.addComplexAliasMember(new ComplexAliasField('PRFA', 'minimumStock', null, null))
+ prodView.addAlias(null, 'offsetATPQtyAvailable', null, null, null, null, null, atpDiffComplexAlias)
if (searchInProductCategoryId) {
- prodView.addMemberEntity("PRCA", "ProductCategoryMember")
- prodView.addViewLink("PRFA", "PRCA", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"))
- prodView.addAlias("PRCA", "productCategoryId", null, null, null, Boolean.TRUE, null)
+ prodView.addMemberEntity('PRCA', 'ProductCategoryMember')
+ prodView.addViewLink('PRFA', 'PRCA', Boolean.FALSE, ModelKeyMap.makeKeyMapList('productId'))
+ prodView.addAlias('PRCA', 'productCategoryId', null, null, null, Boolean.TRUE, null)
conditionMap.productCategoryId = searchInProductCategoryId
- searchParameterString = searchParameterString + "&searchInProductCategoryId=" + searchInProductCategoryId
+ searchParameterString = searchParameterString + '&searchInProductCategoryId=' + searchInProductCategoryId
}
if (productSupplierId) {
- prodView.addMemberEntity("SPPR", "SupplierProduct")
- prodView.addViewLink("PRFA", "SPPR", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"))
- prodView.addAlias("SPPR", "partyId", null, null, null, Boolean.TRUE, null)
+ prodView.addMemberEntity('SPPR', 'SupplierProduct')
+ prodView.addViewLink('PRFA', 'SPPR', Boolean.FALSE, ModelKeyMap.makeKeyMapList('productId'))
+ prodView.addAlias('SPPR', 'partyId', null, null, null, Boolean.TRUE, null)
conditionMap.partyId = productSupplierId
- searchParameterString = searchParameterString + "&productSupplierId=" + productSupplierId
+ searchParameterString = searchParameterString + '&productSupplierId=' + productSupplierId
}
// set distinct on so we only get one row per product
searchCondition = EntityCondition.makeCondition(conditionMap, EntityOperator.AND)
- notVirtualCondition = EntityCondition.makeCondition(EntityCondition.makeCondition("isVirtual", EntityOperator.EQUALS, null),
+ notVirtualCondition = EntityCondition.makeCondition(EntityCondition.makeCondition('isVirtual', EntityOperator.EQUALS, null),
EntityOperator.OR,
- EntityCondition.makeCondition("isVirtual", EntityOperator.NOT_EQUAL, "Y"))
+ EntityCondition.makeCondition('isVirtual', EntityOperator.NOT_EQUAL, 'Y'))
whereConditionsList = [searchCondition, notVirtualCondition]
// add the discontinuation date condition
if (productsSoldThruTimestamp) {
discontinuationDateCondition = EntityCondition.makeCondition(
[
- EntityCondition.makeCondition("salesDiscontinuationDate", EntityOperator.EQUALS, null),
- EntityCondition.makeCondition("salesDiscontinuationDate", EntityOperator.GREATER_THAN,productsSoldThruTimestamp)
+ EntityCondition.makeCondition('salesDiscontinuationDate', EntityOperator.EQUALS, null),
+ EntityCondition.makeCondition('salesDiscontinuationDate', EntityOperator.GREATER_THAN, productsSoldThruTimestamp)
],
EntityOperator.OR)
whereConditionsList.add(discontinuationDateCondition)
- searchParameterString = searchParameterString + "&productsSoldThruTimestamp=" + productsSoldThruTimestamp
+ searchParameterString = searchParameterString + '&productsSoldThruTimestamp=' + productsSoldThruTimestamp
}
// add search on internal name
if (internalName) {
- whereConditionsList.add(EntityCondition.makeCondition("internalName", EntityOperator.LIKE, "%" + internalName + "%"))
- searchParameterString = searchParameterString + "&internalName=" + internalName
+ whereConditionsList.add(EntityCondition.makeCondition('internalName', EntityOperator.LIKE, '%' + internalName + '%'))
+ searchParameterString = searchParameterString + '&internalName=' + internalName
}
// add search on productId
if (productId) {
- whereConditionsList.add(EntityCondition.makeCondition("productId", EntityOperator.LIKE, productId + "%"))
- searchParameterString = searchParameterString + "&productId=" + productId
+ whereConditionsList.add(EntityCondition.makeCondition('productId', EntityOperator.LIKE, productId + '%'))
+ searchParameterString = searchParameterString + '&productId=' + productId
}
orderBy = []
if (hasOffsetATP) {
- orderBy.add("offsetATPQtyAvailable")
+ orderBy.add('offsetATPQtyAvailable')
}
if (hasOffsetQOH) {
- orderBy.add("offsetQOHQtyAvailable")
+ orderBy.add('offsetQOHQtyAvailable')
}
- orderBy.add("productId")
+ orderBy.add('productId')
// If the user has specified a number of months over which to sum usage quantities, define the correct timestamp
checkTime = null
- monthsInPastLimitStr = request.getParameter("monthsInPastLimit")
+ monthsInPastLimitStr = request.getParameter('monthsInPastLimit')
if (monthsInPastLimitStr) {
try {
monthsInPastLimit = Integer.parseInt(monthsInPastLimitStr)
cal = UtilDateTime.toCalendar(null)
cal.add(Calendar.MONTH, 0 - monthsInPastLimit)
checkTime = UtilDateTime.toTimestamp(cal.getTime())
- searchParameterString += "&monthsInPastLimit=" + monthsInPastLimitStr
+ searchParameterString += '&monthsInPastLimit=' + monthsInPastLimitStr
} catch (Exception e) {
- logError(e, "Caught an exception : " + e.toString())
- request.setAttribute("_ERROR_MESSAGE", "An exception occured please check the log")
+ logError(e, 'Caught an exception : ' + e)
+ request.setAttribute('_ERROR_MESSAGE', 'An exception occured please check the log')
}
}
if (checkTime) {
-
// Construct a dynamic view entity to search against for sales usage quantities
- salesUsageViewEntity = new DynamicViewEntity()
- salesUsageViewEntity.addMemberEntity("OI", "OrderItem")
- salesUsageViewEntity.addMemberEntity("OH", "OrderHeader")
- salesUsageViewEntity.addMemberEntity("ItIss", "ItemIssuance")
- salesUsageViewEntity.addMemberEntity("InvIt", "InventoryItem")
- salesUsageViewEntity.addViewLink("OI", "OH", false, ModelKeyMap.makeKeyMapList("orderId"))
- salesUsageViewEntity.addViewLink("OI", "ItIss", false, ModelKeyMap.makeKeyMapList("orderId", "orderId", "orderItemSeqId", "orderItemSeqId"))
- salesUsageViewEntity.addViewLink("ItIss", "InvIt", false, ModelKeyMap.makeKeyMapList("inventoryItemId"))
- salesUsageViewEntity.addAlias("OI", "productId")
- salesUsageViewEntity.addAlias("OH", "statusId")
- salesUsageViewEntity.addAlias("OH", "orderTypeId")
- salesUsageViewEntity.addAlias("OH", "orderDate")
- salesUsageViewEntity.addAlias("ItIss", "inventoryItemId")
- salesUsageViewEntity.addAlias("ItIss", "quantity")
- salesUsageViewEntity.addAlias("InvIt", "facilityId")
+ salesUsageViewEntity = new DynamicViewEntity().with {
+ addMemberEntity('OI', 'OrderItem')
+ addMemberEntity('OH', 'OrderHeader')
+ addMemberEntity('ItIss', 'ItemIssuance')
+ addMemberEntity('InvIt', 'InventoryItem')
+ addViewLink('OI', 'OH', false, ModelKeyMap.makeKeyMapList('orderId'))
+ addViewLink('OI', 'ItIss', false, ModelKeyMap.makeKeyMapList('orderId', 'orderId', 'orderItemSeqId', 'orderItemSeqId'))
+ addViewLink('ItIss', 'InvIt', false, ModelKeyMap.makeKeyMapList('inventoryItemId'))
+ addAlias('OI', 'productId')
+ addAlias('OH', 'statusId')
+ addAlias('OH', 'orderTypeId')
+ addAlias('OH', 'orderDate')
+ addAlias('ItIss', 'inventoryItemId')
+ addAlias('ItIss', 'quantity')
+ addAlias('InvIt', 'facilityId')
+ }
// Construct a dynamic view entity to search against for production usage quantities
- productionUsageViewEntity = new DynamicViewEntity()
- productionUsageViewEntity.addMemberEntity("WEIA", "WorkEffortInventoryAssign")
- productionUsageViewEntity.addMemberEntity("WE", "WorkEffort")
- productionUsageViewEntity.addMemberEntity("II", "InventoryItem")
- productionUsageViewEntity.addViewLink("WEIA", "WE", false, ModelKeyMap.makeKeyMapList("workEffortId"))
- productionUsageViewEntity.addViewLink("WEIA", "II", false, ModelKeyMap.makeKeyMapList("inventoryItemId"))
- productionUsageViewEntity.addAlias("WEIA", "quantity")
- productionUsageViewEntity.addAlias("WE", "actualCompletionDate")
- productionUsageViewEntity.addAlias("WE", "workEffortTypeId")
- productionUsageViewEntity.addAlias("II", "facilityId")
- productionUsageViewEntity.addAlias("II", "productId")
+ productionUsageViewEntity = new DynamicViewEntity().with {
+ addMemberEntity('WEIA', 'WorkEffortInventoryAssign')
+ addMemberEntity('WE', 'WorkEffort')
+ addMemberEntity('II', 'InventoryItem')
+ addViewLink('WEIA', 'WE', false, ModelKeyMap.makeKeyMapList('workEffortId'))
+ addViewLink('WEIA', 'II', false, ModelKeyMap.makeKeyMapList('inventoryItemId'))
+ addAlias('WEIA', 'quantity')
+ addAlias('WE', 'actualCompletionDate')
+ addAlias('WE', 'workEffortTypeId')
+ addAlias('II', 'facilityId')
+ addAlias('II', 'productId')
+ }
Review Comment:
Done Thanks !
--
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
[GitHub] [ofbiz-framework] danwatford commented on pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1498997097
> Hello, Strange, i will check on my local to see what is happening... FYI i did not have plugins installed in that first step. That might explain why the build is success for me...
Ah, I think the plugins explains it. The first file reported is `plugins/scrum/groovyScripts/AddProductBacklogItem.groovy`.
Unless we have a way to exclude, plugins will end up getting included in checks. Having a threshold might be really useful for integrators who have written their own groovy scripts but don't want to or can't reach zero CodeNarc issues at this time.
--
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
[GitHub] [ofbiz-framework] danwatford commented on pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1499032564
> If we suppose it's (only) about integration (GH actions and BB) we could not load the plugins when checking?
I'm not sure. Even if we build ofbiz-framework without the plugins initially. When we subsequently pull the plugins, the 'check' gradle tasks will run again. It would also make the build process more complicated.
I think easiest will be to have a threshold as this will give integrators a way to allow their own plugins/modifications to pass checking without forcing them to immediately fix every issue that CodeNarc might report.
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1173160728
SonarCloud Quality Gate failed. [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![9.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png '9.4%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [9.4% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1380710351
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1088742354
##########
applications/accounting/groovyScripts/admin/ListInvoiceItemTypesGlAccount.groovy:
##########
@@ -30,25 +30,25 @@ invoiceItemTypes = from('InvoiceItemType').where(exprBldr.LIKE(invoiceItemTypeId
context.invoiceItemTypes = invoiceItemTypes.collect { invoiceItemType ->
defaultAccount = true
glAccount = null
- invoiceItemTypeOrgs = invoiceItemType.getRelated("InvoiceItemTypeGlAccount", [organizationPartyId : organizationPartyId], null, false)
+ invoiceItemTypeOrgs = invoiceItemType.getRelated('InvoiceItemTypeGlAccount', [organizationPartyId: organizationPartyId], null, false)
overrideGlAccountId = null
if (invoiceItemTypeOrgs) {
invoiceItemTypeOrg = invoiceItemTypeOrgs[0]
overrideGlAccountId = invoiceItemTypeOrg.glAccountId
- glAccounts = invoiceItemTypeOrg.getRelated("GlAccount", null, null, false)
+ glAccounts = invoiceItemTypeOrg.getRelated('GlAccount', null, null, false)
if (glAccounts) {
glAccount = glAccounts[0]
defaultAccount = false
}
} else {
- glAccount = invoiceItemType.getRelatedOne("DefaultGlAccount", false)
+ glAccount = invoiceItemType.getRelatedOne('DefaultGlAccount', false)
}
- return [invoiceItemTypeId : invoiceItemType.invoiceItemTypeId,
- description : invoiceItemType.description,
- defaultGlAccountId : invoiceItemType.defaultGlAccountId,
- overrideGlAccountId : overrideGlAccountId,
- defaultAccount : defaultAccount,
- activeGlDescription : glAccount?.accountName]
+ return [invoiceItemTypeId: invoiceItemType.invoiceItemTypeId,
+ description: invoiceItemType.description,
+ defaultGlAccountId: invoiceItemType.defaultGlAccountId,
+ overrideGlAccountId: overrideGlAccountId,
+ defaultAccount: defaultAccount,
+ activeGlDescriptio: glAccount?.accountName]
Review Comment:
Nice Catch, Thanks :)
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1089171839
##########
applications/accounting/groovyScripts/admin/FilterOutReceipts.groovy:
##########
@@ -20,4 +20,4 @@
Review Comment:
Reviewed
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1407368649
Thanks to Daniel and Gil, you can post your review results at https://cwiki.apache.org/confluence/display/OFBIZ/Codenarc+integration+review+tracker
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1124527003
##########
framework/webtools/groovyScripts/stats/StatsSinceStart.groovy:
##########
@@ -85,17 +60,23 @@ while (iterator.hasNext()) {
statsId = iterator.next()
Review Comment:
Removed, thanks.
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1124532132
##########
framework/webtools/groovyScripts/service/JobDetails.groovy:
##########
@@ -22,15 +22,15 @@ import org.apache.ofbiz.entity.GenericValue
import org.apache.ofbiz.base.util.UtilGenerics
import org.apache.ofbiz.entity.serialize.XmlSerializer
-GenericValue job = ((Delegator)delegator).findOne("JobSandbox", [jobId:parameters.jobId], false)
+GenericValue job = ((Delegator) delegator).findOne('JobSandbox', [jobId: parameters.jobId], false)
context.job = job
if (job) {
- GenericValue runtimeData = job.getRelatedOne("RuntimeData", false)
+ GenericValue runtimeData = job.getRelatedOne('RuntimeData', false)
if (runtimeData) {
- runtimeInfoMap = UtilGenerics.checkMap(XmlSerializer.deserialize(runtimeData.getString("runtimeInfo"), delegator), String.class, Object.class)
+ runtimeInfoMap = UtilGenerics.checkMap(XmlSerializer.deserialize(runtimeData.getString('runtimeInfo'), delegator), String, Object)
Review Comment:
If that is ok for you we can resolve conversation :)
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1124532372
##########
applications/accounting/groovyScripts/invoice/EditInvoice.groovy:
##########
@@ -94,58 +91,57 @@ if (invoice) {
context.invoiceItems = invoiceItemsConv
- invoiceTotal = InvoiceWorker.getInvoiceTotal(invoice).multiply(conversionRate).setScale(decimals, rounding)
- invoiceNoTaxTotal = InvoiceWorker.getInvoiceNoTaxTotal(invoice).multiply(conversionRate).setScale(decimals, rounding)
+ invoiceTotal = InvoiceWorker.getInvoiceTotal(invoice) * conversionRate.setScale(decimals, rounding)
Review Comment:
Fixed
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1464028937
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1132558499
##########
applications/order/groovyScripts/entry/cart/LookupBulkAddSupplierProducts.groovy:
##########
@@ -62,22 +60,23 @@ conditionList = []
if (productId) {
// make sure the look up is case insensitive
- conditionList.add(EntityCondition.makeCondition(EntityFunction.upper(EntityFieldValue.makeFieldValue("productId")),
- EntityOperator.LIKE, productId.toUpperCase() + "%"))
+ conditionList.add(EntityCondition.makeCondition(EntityFunction.upper(EntityFieldValue.makeFieldValue('productId')),
+ EntityOperator.LIKE, productId.toUpperCase() + '%'))
}
-if (!supplier) {
- supplierPartyId = shoppingCart.getOrderPartyId()
+if (supplier) {
+ supplierPartyId = supplier.getString('partyId')
} else {
- supplierPartyId = supplier.getString("partyId")
+ supplierPartyId = shoppingCart.getOrderPartyId()
Review Comment:
Strange that codenarc didn't detected it :), ok for me !
--
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
Re: [GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by Jacques Le Roux <ja...@les7arts.com>.
I answered to my own question, so deleted the comment (BTW, in groovy we say interpolated not interpreted, like in Python :)
Le 21/03/2023 à 17:05, JacquesLeRoux (via GitHub) a écrit :
> JacquesLeRoux commented on code in PR #517:
> URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1143636661
>
>
> ##########
> applications/product/groovyScripts/product/cost/CostServices.groovy:
> ##########
> @@ -246,67 +239,69 @@ def getTaskCost() {
>
> /**
> * Calculates estimated costs for all the products
> - * @return
> */
> -def calculateAllProductsCosts() {
> +Map calculateAllProductsCosts() {
> // filter-by-date="true"
> - List products = from("Product").orderBy("-billOfMaterialLevel").select("productId").queryList()
> + List products = from('Product').orderBy('-billOfMaterialLevel').select('productId').queryList()
> Map inMap = [currencyUomId: parameters.currencyUomId, costComponentTypePrefix: parameters.costComponentTypePrefix]
> for (GenericValue product : products) {
> inMap.productId = product.productId
> - run service: "calculateProductCosts", with: inMap
> + run service: 'calculateProductCosts', with: inMap
> }
> return success()
> }
>
> /**
> * Calculates the product's cost
> - * @return
> */
> -def calculateProductCosts() {
> +Map calculateProductCosts() {
> Map result = success()
> Map totalCostsByType = [:]
> BigDecimal totalProductCost = (BigDecimal) 0
> BigDecimal totalTaskCost = (BigDecimal) 0
> BigDecimal totalOtherTaskCost = (BigDecimal) 0
> // the existing costs are expired
> - Map cancelMap = [costComponentTypeId: (String) "${parameters.costComponentTypePrefix}_ROUTE_COST", productId: parameters.productId, costUomId: parameters.currencyUomId]
> - run service: "cancelCostComponents", with: cancelMap
> + Map cancelMap = [costComponentTypeId: (String) "${parameters.costComponentTypePrefix}_ROUTE_COST",
>
> Review Comment:
> Why not s simple string here and below? Because it must be interpreted?
>
>
>
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1143636661
##########
applications/product/groovyScripts/product/cost/CostServices.groovy:
##########
@@ -246,67 +239,69 @@ def getTaskCost() {
/**
* Calculates estimated costs for all the products
- * @return
*/
-def calculateAllProductsCosts() {
+Map calculateAllProductsCosts() {
// filter-by-date="true"
- List products = from("Product").orderBy("-billOfMaterialLevel").select("productId").queryList()
+ List products = from('Product').orderBy('-billOfMaterialLevel').select('productId').queryList()
Map inMap = [currencyUomId: parameters.currencyUomId, costComponentTypePrefix: parameters.costComponentTypePrefix]
for (GenericValue product : products) {
inMap.productId = product.productId
- run service: "calculateProductCosts", with: inMap
+ run service: 'calculateProductCosts', with: inMap
}
return success()
}
/**
* Calculates the product's cost
- * @return
*/
-def calculateProductCosts() {
+Map calculateProductCosts() {
Map result = success()
Map totalCostsByType = [:]
BigDecimal totalProductCost = (BigDecimal) 0
BigDecimal totalTaskCost = (BigDecimal) 0
BigDecimal totalOtherTaskCost = (BigDecimal) 0
// the existing costs are expired
- Map cancelMap = [costComponentTypeId: (String) "${parameters.costComponentTypePrefix}_ROUTE_COST", productId: parameters.productId, costUomId: parameters.currencyUomId]
- run service: "cancelCostComponents", with: cancelMap
+ Map cancelMap = [costComponentTypeId: (String) "${parameters.costComponentTypePrefix}_ROUTE_COST",
Review Comment:
Why not s simple string here and below? Because it must be interpreted?
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1146353305
##########
applications/product/groovyScripts/product/product/ProductServices.groovy:
##########
@@ -841,22 +867,24 @@ def checkOrderItemForProductGroupOrder() {
/**
* Cancle OrderItemGroupOrder
*/
-def cancleOrderItemGroupOrder() {
+Map cancleOrderItemGroupOrder() {
Review Comment:
That could be indeed be done later, notably because it also entails other changes in code
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147816795
##########
applications/product/groovyScripts/product/cost/CostServices.groovy:
##########
@@ -495,15 +497,14 @@ def getProductAverageCost() {
/**
* Formula that creates a cost component equal to a percentage of total product cost
- * @return
*/
-def productCostPercentageFormula() {
+Map productCostPercentageFormula() {
Map result = success()
GenericValue productCostComponentCalc = parameters.productCostComponentCalc
GenericValue costComponentCalc = parameters.costComponentCalc
- Map inputMap = [productId: productCostComponentCalc.productId, currencyUomId: parameters.currencyUomId, costComponentTypePrefix: parameters.costComponentTypePrefix]
- Map serviceResult = run service: "getProductCost", with: inputMap
- BigDecimal productCost = serviceResult.productCost
+ Map inputMap = [productId: productCostComponentCalc.productId, currencyUomId: parameters.currencyUomId,
+ costComponentTypePrefix: parameters.costComponentTypePrefix]
+ run service: 'getProductCost', with: inputMap
// set field="productCostAdjustment" value="${parameters.baseCost * costComponentCalc.fixedCost}" type="BigDecimal"/
Review Comment:
Like Dan said in another comment, i had to refrain to change a lot of things during rule fixes, let's try to avoid mixing objectives in this pull-request :)
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1143685341
##########
applications/product/groovyScripts/product/cost/CostServices.groovy:
##########
@@ -495,15 +497,14 @@ def getProductAverageCost() {
/**
* Formula that creates a cost component equal to a percentage of total product cost
- * @return
*/
-def productCostPercentageFormula() {
+Map productCostPercentageFormula() {
Map result = success()
GenericValue productCostComponentCalc = parameters.productCostComponentCalc
GenericValue costComponentCalc = parameters.costComponentCalc
- Map inputMap = [productId: productCostComponentCalc.productId, currencyUomId: parameters.currencyUomId, costComponentTypePrefix: parameters.costComponentTypePrefix]
- Map serviceResult = run service: "getProductCost", with: inputMap
- BigDecimal productCost = serviceResult.productCost
+ Map inputMap = [productId: productCostComponentCalc.productId, currencyUomId: parameters.currencyUomId,
+ costComponentTypePrefix: parameters.costComponentTypePrefix]
+ run service: 'getProductCost', with: inputMap
// set field="productCostAdjustment" value="${parameters.baseCost * costComponentCalc.fixedCost}" type="BigDecimal"/
Review Comment:
Should we keep this comment and if so why?
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147831396
##########
applications/product/groovyScripts/product/promo/ProductPromoActionServices.groovy:
##########
@@ -173,18 +183,19 @@ def productGWP() {
Iterator<String> optionProductIdTempIter = optionProductIds.iterator()
productId = optionProductIdTempIter.next()
optionProductIdTempIter.remove()
- product = from("Product").where("productId", productId).cache().queryOne()
+ product = from('Product').where('productId', productId).cache().queryOne()
}
if (!product) {
// no product found to add as GWP, just return
- return
+ return [*:result, actionResultInfo: parameters.actionResultInfo]
Review Comment:
IIRW This one took me some time to guess, it was revealed by ReturnsNullInsteadOfEmptyCollection, thus when returning [] was causing issue. After investigation, it is a service, and in that regard, it should return success or error, not nothing.
> Fix codenarc ReturnsNullInsteadOfEmptyCollection rules : Consider returning a zero length collection rather than null. It is often a better design to return a length zero collection rather than a null reference to indicate that there are no results (i.e., an empty list of results). This way, no explicit check for null is needed by clients of the method.
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147873079
##########
applications/order/groovyScripts/shoppinglist/ShoppingListServices.groovy:
##########
@@ -131,39 +123,30 @@ def updateShoppingListItem() {
/**
* Remove a ShoppingListItem
- * @return
*/
-def removeShoppingListItem() {
- GenericValue shoppingList = from("ShoppingList").where(parameters).queryOne()
- GenericValue shoppingListItem = from("ShoppingListItem").where(parameters).queryOne()
+Map removeShoppingListItem() {
+ GenericValue shoppingList = from('ShoppingList').where(parameters).queryOne()
+ GenericValue shoppingListItem = from('ShoppingListItem').where(parameters).queryOne()
shoppingListItem.remove()
updateLastAdminModified(shoppingList, userLogin)
return success()
}
Review Comment:
I speak about updateLastAdminModified()
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1485377643
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [3 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1497605083
I changed to "passed", since indeed anyway conflicts will show and will need to be fixed.
--
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
[GitHub] [ofbiz-framework] danwatford commented on a diff in pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1119267427
##########
applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/AutoAcctgFinAccountTests.groovy:
##########
@@ -179,20 +178,26 @@ class AutoAcctgFinAccountTests extends OFBizTestCase {
assert serviceResult.finAccountAuthId != null
}
- void setFinAccountTransStatus() {
+ void testSetFinAccountTransStatus() {
Map serviceCtx = [
finAccountTransId: '1010',
statusId: 'FINACT_TRNS_APPROVED',
userLogin: userLogin
]
+ GenericValue finAccountTrans = from('FinAccountTrans')
+ .where('finAccountTransId', '1010')
+ .queryOne()
+ String oldStatusId = finAccountTrans.statusId
+
Map serviceResult = dispatcher.runSync('setFinAccountTransStatus', serviceCtx)
assert ServiceUtil.isSuccess(serviceResult)
- GenericValue finAccountTrans = from('FinAccountTrans')
+ finAccountTrans = from('FinAccountTrans')
.where('finAccountTransId', '1010')
.queryOne()
assert finAccountTrans
assert finAccountTrans.statusId == 'FINACT_TRNS_APPROVED'
- assert finAccountTrans.oldStatusId == 'FINACT_TRNS_CREATED'
Review Comment:
Appears to be a change in behaviour.
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1186310894
SonarCloud Quality Gate failed. [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![9.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png '9.4%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [9.4% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1172471042
SonarCloud Quality Gate failed. [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![9.4%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/10-16px.png '9.4%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [9.4% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1369499118
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1367922856
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1367955033
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1381720972
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1381955894
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by sonarcloud.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1406709243
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1089170827
##########
applications/accounting/groovyScripts/admin/AcctgAdminServices.groovy:
##########
@@ -25,45 +25,47 @@ import org.apache.ofbiz.entity.GenericValue
import org.apache.ofbiz.entity.util.EntityUtil
Review Comment:
Reviewed
--
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
[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1453613352
Kudos, SonarCloud Quality Gate passed! [![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')](https://sonarcloud.io/dashboard?id=apache_ofbiz-framework&pullRequest=517)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework&pullRequest=517&resolved=false&types=CODE_SMELL)
[![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517) No Coverage information
[![2.1%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '2.1%')](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list) [2.1% Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework&pullRequest=517&metric=new_duplicated_lines_density&view=list)
--
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
[GitHub] [ofbiz-framework] mleila37 commented on a diff in pull request #517: Codenarc integration
Posted by "mleila37 (via GitHub)" <gi...@apache.org>.
mleila37 commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1123324451
##########
applications/order/groovyScripts/entry/BillSettings.groovy:
##########
@@ -66,20 +66,20 @@ if (cart) {
checkOutPaymentId = cart.getPaymentMethodIds().get(0)
context.checkOutPaymentId = checkOutPaymentId
if (!orderParty) {
- paymentMethod = from("PaymentMethod").where("paymentMethodId", checkOutPaymentId).queryOne()
- if ("CREDIT_CARD".equals(paymentMethod?.paymentMethodTypeId)) {
- paymentMethodType = "CC"
- account = paymentMethod.getRelatedOne("CreditCard", false)
+ paymentMethod = from('PaymentMethod').where('paymentMethodId', checkOutPaymentId).queryOne()
+ if (paymentMethod?.paymentMethodTypeId == 'CREDIT_CARD') {
+ paymentMethodType = 'CC'
+ account = paymentMethod.getRelatedOne('CreditCard', false)
context.creditCard = account
context.paymentMethodType = paymentMethodType
- } else if ("EFT_ACCOUNT".equals(paymentMethod.paymentMethodTypeId)) {
- paymentMethodType = "EFT"
- account = paymentMethod.getRelatedOne("EftAccount", false)
+ } else if (paymentMethod.paymentMethodTypeId == 'EFT_ACCOUNT') {
Review Comment:
Not related to codenarc application but there is a potential NPE to check
(paymentMethod. instead of paymentMethod?.)
--
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
[GitHub] [ofbiz-framework] gilPts commented on pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1498984746
Hello,
Strange, i will check on my local to see what is happening... FYI i did not have plugins installed in that first step. That might explain why the build is success for me...
--
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
[GitHub] [ofbiz-framework] danwatford commented on pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#issuecomment-1498998327
> >
>
> About BalanceSheet.groovy and others framework groovy file, I can rebase this branch onto trunk and process the files that are detected by codenarc, then push in another pull request listing the files I worked on. That will let us review those quickly and finish that work.
Sounds good to me
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1143636661
##########
applications/product/groovyScripts/product/cost/CostServices.groovy:
##########
@@ -246,67 +239,69 @@ def getTaskCost() {
/**
* Calculates estimated costs for all the products
- * @return
*/
-def calculateAllProductsCosts() {
+Map calculateAllProductsCosts() {
// filter-by-date="true"
- List products = from("Product").orderBy("-billOfMaterialLevel").select("productId").queryList()
+ List products = from('Product').orderBy('-billOfMaterialLevel').select('productId').queryList()
Map inMap = [currencyUomId: parameters.currencyUomId, costComponentTypePrefix: parameters.costComponentTypePrefix]
for (GenericValue product : products) {
inMap.productId = product.productId
- run service: "calculateProductCosts", with: inMap
+ run service: 'calculateProductCosts', with: inMap
}
return success()
}
/**
* Calculates the product's cost
- * @return
*/
-def calculateProductCosts() {
+Map calculateProductCosts() {
Map result = success()
Map totalCostsByType = [:]
BigDecimal totalProductCost = (BigDecimal) 0
BigDecimal totalTaskCost = (BigDecimal) 0
BigDecimal totalOtherTaskCost = (BigDecimal) 0
// the existing costs are expired
- Map cancelMap = [costComponentTypeId: (String) "${parameters.costComponentTypePrefix}_ROUTE_COST", productId: parameters.productId, costUomId: parameters.currencyUomId]
- run service: "cancelCostComponents", with: cancelMap
+ Map cancelMap = [costComponentTypeId: (String) "${parameters.costComponentTypePrefix}_ROUTE_COST",
Review Comment:
Why not s simple string here?
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147545765
##########
applications/product/groovyScripts/product/promo/ProductPromoActionServices.groovy:
##########
@@ -161,9 +169,11 @@ def productGWP() {
}
optionProductIds.remove(alternateGwpProductId)
productId = alternateGwpProductId
- product = from("Product").where("productId", productId).cache().queryOne()
+ product = from('Product').where('productId', productId).cache().queryOne()
} else {
- logWarning(UtilProperties.getMessage(resource_error, "OrderAnAlternateGwpProductIdWasInPlaceButWasEitherNotValidOrIsNoLongerInStockForId", UtilMisc.toMap("alternateGwpProductId", alternateGwpProductId), cart.getLocale()))
+ logWarning(UtilProperties.getMessage(resource_error,
+ 'OrderAnAlternateGwpProductIdWasInPlaceButWasEitherNotValidOrIsNoLongerInStockForId',
+ [alternateGwpProductId: alternateGwpProductId], cart.getLocale()))
Review Comment:
alternateGwpProductId misses quotes, right?
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147814844
##########
applications/product/groovyScripts/facility/shipment/PrintPickSheets.groovy:
##########
@@ -60,16 +59,18 @@ if (toPrintOrders) {
orderMap.orderId = orderId
orderMap.orderDate = orderHeader.orderDate
billingOrderContactMechs = []
- billingOrderContactMechs = from("OrderContactMech").where("orderId", orderId, "contactMechPurposeTypeId", "BILLING_LOCATION").queryList()
+ billingOrderContactMechs = from('OrderContactMech')
+ .where('orderId', orderId, 'contactMechPurposeTypeId', 'BILLING_LOCATION').queryList()
if (billingOrderContactMechs.size() > 0) {
billingContactMechId = EntityUtil.getFirst(billingOrderContactMechs).contactMechId
- billingAddress = from("PostalAddress").where("contactMechId", billingContactMechId).queryOne()
+ billingAddress = from('PostalAddress').where('contactMechId', billingContactMechId).queryOne()
}
- shippingContactMechId = from("OrderContactMech").where("orderId", orderId, "contactMechPurposeTypeId", "SHIPPING_LOCATION").queryFirst().contactMechId
- shippingAddress = from("PostalAddress").where("contactMechId", shippingContactMechId).queryOne()
+ shippingContactMechId = from('OrderContactMech')
+ .where('orderId', orderId, 'contactMechPurposeTypeId', 'SHIPPING_LOCATION').queryFirst().contactMechId
+ shippingAddress = from('PostalAddress').where('contactMechId', shippingContactMechId).queryOne()
orderItemShipGroups.each { orderItemShipGroup ->
if (orderItemShipGroup.orderId == orderId) {
- orderMap.shipmentMethodType = EntityUtil.getFirst(orderItemShipGroup.getRelated("ShipmentMethodType", null, null, false)).description
+ orderMap.shipmentMethodType = orderItemShipGroup.getRelated('ShipmentMethodType', null, null, false)[0]?.description
Review Comment:
It was one equivalent way of writing it to respect the line length rule.
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147866086
##########
applications/marketing/groovyScripts/marketing/reports/MarketingCampaignReport.groovy:
##########
@@ -23,26 +23,28 @@ import org.apache.ofbiz.marketing.report.ReportHelper
//query for both number of visits and number of orders
-marketingCampaignId = request.getParameter("marketingCampaignId")
+marketingCampaignId = request.getParameter('marketingCampaignId')
visitConditionList = [] as LinkedList
orderConditionList = [] as LinkedList
if (fromDate) {
- visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
- orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
+ visitConditionList.add(EntityCondition.makeCondition('fromDate', EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
+ orderConditionList.add(EntityCondition.makeCondition('orderDate', EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
}
if (thruDate) {
- visitConditionList.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
- orderConditionList.add(EntityCondition.makeCondition("orderDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
+ visitConditionList.add(EntityCondition.makeCondition('fromDate', EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
+ orderConditionList.add(EntityCondition.makeCondition('orderDate', EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
}
if (marketingCampaignId) {
- visitConditionList.add(EntityCondition.makeCondition("marketingCampaignId", EntityOperator.EQUALS, marketingCampaignId))
- orderConditionList.add(EntityCondition.makeCondition("marketingCampaignId", EntityOperator.EQUALS, marketingCampaignId))
+ visitConditionList.add(EntityCondition.makeCondition('marketingCampaignId', EntityOperator.EQUALS, marketingCampaignId))
+ orderConditionList.add(EntityCondition.makeCondition('marketingCampaignId', EntityOperator.EQUALS, marketingCampaignId))
}
-visits = select("marketingCampaignId", "visitId").from("MarketingCampaignAndVisit").where(visitConditionList).orderBy("marketingCampaignId").queryList()
-orders = select("marketingCampaignId", "orderId", "grandTotal").from("MarketingCampaignAndOrderHeader").where(orderConditionList).orderBy("marketingCampaignId").queryList()
+visits = select('marketingCampaignId', 'visitId')
+ .from('MarketingCampaignAndVisit').where(visitConditionList).orderBy('marketingCampaignId').queryList()
+orders = select('marketingCampaignId', 'orderId', 'grandTotal')
+ .from('MarketingCampaignAndOrderHeader').where(orderConditionList).orderBy('marketingCampaignId').queryList()
Review Comment:
I think there are other such cases... Can be done later... or not...
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1146194797
##########
applications/product/groovyScripts/product/product/ProductServices.groovy:
##########
@@ -841,22 +867,24 @@ def checkOrderItemForProductGroupOrder() {
/**
* Cancle OrderItemGroupOrder
*/
-def cancleOrderItemGroupOrder() {
+Map cancleOrderItemGroupOrder() {
Review Comment:
Change to cancel would be good;) in comment also...
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147803806
##########
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:
Done with
https://github.com/gilPts/ofbiz-framework/commit/237c60519505d8b3610a5feb5d33eafa519e4b09
--
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
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1147865371
##########
applications/accounting/groovyScripts/reports/CostCenters.groovy:
##########
@@ -26,50 +25,49 @@ import org.apache.ofbiz.entity.condition.EntityOperator
if (!fromDate) {
return
}
-if (!thruDate) {
- thruDate = UtilDateTime.nowTimestamp()
-}
-if (!parameters.glFiscalTypeId) {
- parameters.glFiscalTypeId = "ACTUAL"
-}
+thruDate = thruDate ?: UtilDateTime.nowTimestamp()
+parameters.glFiscalTypeId = parameters.glFiscalTypeId ?: 'ACTUAL'
// POSTED
// Posted transactions totals and grand totals
postedTotalDebit = BigDecimal.ZERO
postedTotalCredit = BigDecimal.ZERO
andExprs = []
-andExprs.add(EntityCondition.makeCondition("organizationPartyId", EntityOperator.IN, partyIds))
-andExprs.add(EntityCondition.makeCondition("isPosted", EntityOperator.EQUALS, "Y"))
-andExprs.add(EntityCondition.makeCondition("glFiscalTypeId", EntityOperator.EQUALS, parameters.glFiscalTypeId))
-andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
-andExprs.add(EntityCondition.makeCondition("transactionDate", EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
+andExprs.add(EntityCondition.makeCondition('organizationPartyId', EntityOperator.IN, partyIds))
+andExprs.add(EntityCondition.makeCondition('isPosted', EntityOperator.EQUALS, 'Y'))
+andExprs.add(EntityCondition.makeCondition('glFiscalTypeId', EntityOperator.EQUALS, parameters.glFiscalTypeId))
+andExprs.add(EntityCondition.makeCondition('transactionDate', EntityOperator.GREATER_THAN_EQUAL_TO, fromDate))
+andExprs.add(EntityCondition.makeCondition('transactionDate', EntityOperator.LESS_THAN_EQUAL_TO, thruDate))
andCond = EntityCondition.makeCondition(andExprs, EntityOperator.AND)
-List postedTransactionTotals = select("glAccountId", "accountName", "accountCode", "debitCreditFlag", "amount").from("AcctgTransEntrySums").where(andCond).orderBy("glAccountId").queryList()
+List postedTransactionTotals = select('glAccountId', 'accountName', 'accountCode', 'debitCreditFlag', 'amount')
+ .from('AcctgTransEntrySums').where(andCond).orderBy('glAccountId').queryList()
if (postedTransactionTotals) {
- glAccountCategories = from("GlAccountCategory").where("glAccountCategoryTypeId", "COST_CENTER").orderBy("glAccountCategoryId").queryList()
+ glAccountCategories = from('GlAccountCategory').where('glAccountCategoryTypeId', 'COST_CENTER').orderBy('glAccountCategoryId').queryList()
context.glAccountCategories = glAccountCategories
Map postedTransactionTotalsMap = [:]
postedTransactionTotals.each { postedTransactionTotal ->
Map accountMap = (Map)postedTransactionTotalsMap.get(postedTransactionTotal.glAccountId)
if (!accountMap) {
accountMap = UtilMisc.makeMapWritable(postedTransactionTotal)
- accountMap.put("D", BigDecimal.ZERO)
- accountMap.put("C", BigDecimal.ZERO)
+ accountMap.put('D', BigDecimal.ZERO)
+ accountMap.put('C', BigDecimal.ZERO)
}
UtilMisc.addToBigDecimalInMap(accountMap, postedTransactionTotal.debitCreditFlag, postedTransactionTotal.amount)
postedTransactionTotalsMap.put(postedTransactionTotal.glAccountId, accountMap)
- BigDecimal debitAmount = (BigDecimal)accountMap.get("D")
- BigDecimal creditAmount = (BigDecimal)accountMap.get("C")
+ BigDecimal debitAmount = (BigDecimal)accountMap.get('D')
+ BigDecimal creditAmount = (BigDecimal)accountMap.get('C')
BigDecimal balance = debitAmount.subtract(creditAmount)
- accountMap.put("balance", balance)
+ accountMap.put('balance', balance)
glAccountCategories.each { glAccountCategory ->
- glAccountCategoryMember = from("GlAccountCategoryMember").where("glAccountCategoryId", glAccountCategory.glAccountCategoryId, "glAccountId", postedTransactionTotal.glAccountId).orderBy("glAccountCategoryId").filterByDate().queryFirst()
+ glAccountCategoryMember = from('GlAccountCategoryMember')
+ .where('glAccountCategoryId', glAccountCategory.glAccountCategoryId, 'glAccountId', postedTransactionTotal.glAccountId)
+ .orderBy('glAccountCategoryId').filterByDate().queryFirst()
if (glAccountCategoryMember) {
BigDecimal glAccountCategorySharePercentage = glAccountCategoryMember.amountPercentage
if (glAccountCategorySharePercentage && glAccountCategorySharePercentage != BigDecimal.ZERO ) {
Review Comment:
OK
--
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
[GitHub] [ofbiz-framework] danwatford closed pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford closed pull request #517: Codenarc integration
URL: https://github.com/apache/ofbiz-framework/pull/517
--
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
[GitHub] [ofbiz-framework] danwatford commented on a diff in pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1158367157
##########
framework/common/groovyScripts/CommonServices.groovy:
##########
@@ -350,107 +335,112 @@ def createKeywordThesaurus() {
/**
* Delete a complete Entry KeywordThesaurus
- * @return
*/
-def deleteKeywordThesaurus() {
- GenericValue newEntity = makeValue("KeywordThesaurus")
+Map deleteKeywordThesaurus() {
+ GenericValue newEntity = makeValue('KeywordThesaurus')
newEntity.enteredKeyword = parameters.enteredKeyword
if (parameters.alternateKeyword) {
newEntity.alternateKeyword = parameters.alternateKeyword
}
- delegator.removeByAnd("KeywordThesaurus", newEntity)
+ delegator.removeByAnd('KeywordThesaurus', newEntity)
return success()
}
-def createFuturePeriod() {
+Map createFuturePeriod() {
applTypes = []
grain = null
intermediate = null
- parties = from('PartyAcctgPreference').where('enableAccounting','Y').queryIterator()
- while (party = parties.next()){
+ parties = from('PartyAcctgPreference').where('enableAccounting', 'Y').queryIterator()
+ while (parties.hasNext()) {
+ party = parties.next()
parameters.organizationPartyId = party.partyId
createCustomTimePeriod = from('SystemProperty')
- .where('systemResourceId','general', 'systemPropertyId','CustomTimePeriod.create').queryOne()
- if ("Y".equals(createCustomTimePeriod.systemPropertyValue)) {
+ .where('systemResourceId', 'general', 'systemPropertyId', 'CustomTimePeriod.create').queryOne()
+ if (createCustomTimePeriod.systemPropertyValue == 'Y') {
// get list of CustomTypePeriod types
applTypes = from('SystemProperty')
- .where('systemResourceId','general', 'systemPropertyId','CustomTimePeriod.applType').queryOne()
- List types = Arrays.asList(applTypes.systemPropertyValue.split("\\s*,\\s*"))
- types.each{periodTypeId ->
- Calendar periodCal = Calendar.getInstance();
- systemPropertyId = "CustomTimePeriod." + periodTypeId + ".intermediate"
+ .where('systemResourceId', 'general', 'systemPropertyId', 'CustomTimePeriod.applType').queryOne()
+ List types = Arrays.asList(applTypes.systemPropertyValue.split('\\s*,\\s*'))
+ types.each { periodTypeId ->
+ Calendar periodCal = Calendar.getInstance()
+ systemPropertyId = 'CustomTimePeriod.' + periodTypeId + '.intermediate'
applTypeInter = from('SystemProperty')
- .where('systemResourceId','general', 'systemPropertyId',systemPropertyId).queryOne()
+ .where('systemResourceId', 'general', 'systemPropertyId', systemPropertyId).queryOne()
if (applTypeInter) {
intermediate = applTypeInter.systemPropertyValue
}
// get grain for application type
- systemPropertyId = "CustomTimePeriod." + periodTypeId + ".grain"
+ systemPropertyId = 'CustomTimePeriod.' + periodTypeId + '.grain'
applTypeGrain = from('SystemProperty')
- .where('systemResourceId','general', 'systemPropertyId',systemPropertyId).queryOne()
+ .where('systemResourceId', 'general', 'systemPropertyId', systemPropertyId).queryOne()
if (applTypeGrain) {
grain = applTypeGrain.systemPropertyValue
- if ("MONTH".equals(grain)) {
+ if (grain == 'MONTH') {
periodCal.add(Calendar.MONTH, 1)
- monthName = new SimpleDateFormat("MMM").format(periodCal.getTime())
+ monthName = new SimpleDateFormat('MMM', locale).format(periodCal.getTime())
Review Comment:
I agree with the change if since it is needed to satisfy the codenarc rule and doesn't appear to affect the desired outcome for the user. Thanks
--
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
[GitHub] [ofbiz-framework] gilPts commented on a diff in pull request #517: Codenarc integration
Posted by "gilPts (via GitHub)" <gi...@apache.org>.
gilPts commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1158201088
##########
framework/common/groovyScripts/CommonServices.groovy:
##########
@@ -350,107 +335,112 @@ def createKeywordThesaurus() {
/**
* Delete a complete Entry KeywordThesaurus
- * @return
*/
-def deleteKeywordThesaurus() {
- GenericValue newEntity = makeValue("KeywordThesaurus")
+Map deleteKeywordThesaurus() {
+ GenericValue newEntity = makeValue('KeywordThesaurus')
newEntity.enteredKeyword = parameters.enteredKeyword
if (parameters.alternateKeyword) {
newEntity.alternateKeyword = parameters.alternateKeyword
}
- delegator.removeByAnd("KeywordThesaurus", newEntity)
+ delegator.removeByAnd('KeywordThesaurus', newEntity)
return success()
}
-def createFuturePeriod() {
+Map createFuturePeriod() {
applTypes = []
grain = null
intermediate = null
- parties = from('PartyAcctgPreference').where('enableAccounting','Y').queryIterator()
- while (party = parties.next()){
+ parties = from('PartyAcctgPreference').where('enableAccounting', 'Y').queryIterator()
+ while (parties.hasNext()) {
+ party = parties.next()
parameters.organizationPartyId = party.partyId
createCustomTimePeriod = from('SystemProperty')
- .where('systemResourceId','general', 'systemPropertyId','CustomTimePeriod.create').queryOne()
- if ("Y".equals(createCustomTimePeriod.systemPropertyValue)) {
+ .where('systemResourceId', 'general', 'systemPropertyId', 'CustomTimePeriod.create').queryOne()
+ if (createCustomTimePeriod.systemPropertyValue == 'Y') {
// get list of CustomTypePeriod types
applTypes = from('SystemProperty')
- .where('systemResourceId','general', 'systemPropertyId','CustomTimePeriod.applType').queryOne()
- List types = Arrays.asList(applTypes.systemPropertyValue.split("\\s*,\\s*"))
- types.each{periodTypeId ->
- Calendar periodCal = Calendar.getInstance();
- systemPropertyId = "CustomTimePeriod." + periodTypeId + ".intermediate"
+ .where('systemResourceId', 'general', 'systemPropertyId', 'CustomTimePeriod.applType').queryOne()
+ List types = Arrays.asList(applTypes.systemPropertyValue.split('\\s*,\\s*'))
+ types.each { periodTypeId ->
+ Calendar periodCal = Calendar.getInstance()
+ systemPropertyId = 'CustomTimePeriod.' + periodTypeId + '.intermediate'
applTypeInter = from('SystemProperty')
- .where('systemResourceId','general', 'systemPropertyId',systemPropertyId).queryOne()
+ .where('systemResourceId', 'general', 'systemPropertyId', systemPropertyId).queryOne()
if (applTypeInter) {
intermediate = applTypeInter.systemPropertyValue
}
// get grain for application type
- systemPropertyId = "CustomTimePeriod." + periodTypeId + ".grain"
+ systemPropertyId = 'CustomTimePeriod.' + periodTypeId + '.grain'
applTypeGrain = from('SystemProperty')
- .where('systemResourceId','general', 'systemPropertyId',systemPropertyId).queryOne()
+ .where('systemResourceId', 'general', 'systemPropertyId', systemPropertyId).queryOne()
if (applTypeGrain) {
grain = applTypeGrain.systemPropertyValue
- if ("MONTH".equals(grain)) {
+ if (grain == 'MONTH') {
periodCal.add(Calendar.MONTH, 1)
- monthName = new SimpleDateFormat("MMM").format(periodCal.getTime())
+ monthName = new SimpleDateFormat('MMM', locale).format(periodCal.getTime())
Review Comment:
Even if i agree with you, this edit is to comply the codenarc SimpleDateFormatMissingLocale rule.
So i guess we should keep it
Be sure to specify a Locale when creating a new instance of SimpleDateFormat; the class is locale-sensitive. If you instantiate SimpleDateFormat without a Locale parameter, it will format the date and time according to the default Locale. Both the pattern and the Locale determine the format. For the same pattern, SimpleDateFormat may format a date and time differently if the Locale varies
--
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
[GitHub] [ofbiz-framework] danwatford commented on a diff in pull request #517: Codenarc integration
Posted by "danwatford (via GitHub)" <gi...@apache.org>.
danwatford commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1158373027
##########
framework/webtools/groovyScripts/entity/XmlDsDump.groovy:
##########
@@ -17,151 +17,158 @@
* under the License.
*/
-import java.util.*
-import java.io.*
-import org.apache.ofbiz.base.util.*
-import org.apache.ofbiz.entity.model.*
-import org.apache.ofbiz.entity.util.*
-import org.apache.ofbiz.entity.transaction.*
-import org.apache.ofbiz.entity.condition.*
+import org.apache.ofbiz.base.util.Debug
+import org.apache.ofbiz.base.util.UtilFormatOut
+import org.apache.ofbiz.entity.condition.EntityComparisonOperator
+import org.apache.ofbiz.entity.condition.EntityCondition
+import org.apache.ofbiz.entity.condition.EntityJoinOperator
+import org.apache.ofbiz.entity.model.ModelViewEntity
+import org.apache.ofbiz.entity.transaction.TransactionUtil
+import org.apache.ofbiz.entity.util.EntityFindOptions
outpath = parameters.outpath
filename = parameters.filename
maxRecStr = parameters.maxrecords
entitySyncId = parameters.entitySyncId
passedEntityNames = null
-if (parameters.entityName) passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet
+if (parameters.entityName) {
+ passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet
+}
// get the max records per file setting and convert to a int
-maxRecordsPerFile = 0
-if (maxRecStr) {
- try {
- maxRecordsPerFile = Integer.parseInt(maxRecStr)
- }
- catch (Exception e) {
- }
-}
+int maxRecordsPerFile = maxRecStr ? (maxRecStr as int) : 0
Review Comment:
My apologies.
GitHub was showing me an older version of the file, probably because I clicked on the link associated with this review, rather than navigating to the file from the Files Changed tab.
I can now see the updated version.
--
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
Re: [GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by Jacques Le Roux <ja...@les7arts.com>.
Deleted, was a misunderstanding
Le 14/03/2023 à 10:46, JacquesLeRoux (via GitHub) a écrit :
> JacquesLeRoux commented on code in PR #517:
> URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1135270359
>
>
> ##########
> applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/InvoicePerShipmentTests.groovy:
> ##########
> @@ -34,152 +31,155 @@ import org.apache.ofbiz.shipment.packing.PackingSession
> import org.springframework.mock.web.MockHttpServletRequest
> import org.springframework.mock.web.MockHttpServletResponse
>
> +import javax.servlet.http.HttpSession
>
> -public class InvoicePerShipmentTests extends OFBizTestCase {
> - public InvoicePerShipmentTests(String name) {
> +class InvoicePerShipmentTests extends OFBizTestCase {
> +
> + InvoicePerShipmentTests(String name) {
> super(name)
> }
>
> - def testInvoicePerShipment(String productId, String invoicePerShipment) {
> + void testInvoicePerShipmentSetFalse() {
> + /* Test Invoice Per Shipment
> + Step 1) Set create.invoice.per.shipment=N in accounting.properties file.
> + Step 2) Create order and approve order.
> + Step 3) Pack Shipment For Ship Group.
> + Step 4) Check invoice should not created.
> + */
> + List invoices = testInvoicePerShipment('GZ-1000', 'N')
> + assert UtilValidate.isEmpty(invoices)
> + }
> +
> + void testInvoicePerShipmentSetTrue() {
> + /* Test Invoice Per Shipment
> + Step 1) Set create.invoice.per.shipment=Y in accounting.properties file.
> + Step 2) Create order and approve order.
> + Step 3) Pack Shipment For Ship Group.
> + Step 4) Check invoice should be created.
> + */
> + List invoices = testInvoicePerShipment('GZ-1000', 'Y')
> + assert UtilValidate.isNotEmpty(invoices)
> + }
> +
> + void testInvoicePerShipmentSetOrderFalse() {
> + /* Test Invoice Per Shipment
> + Step 1) Create order and set invoicePerShipment=N.
> + Step 2) Pack Shipment For Ship Group.
> + Step 3) Check invoice should not be created.
> + */
> + List invoices = testInvoicePerShipment('GZ-2644', 'N')
> + assert UtilValidate.isEmpty(invoices)
> + }
> +
> + void testInvoicePerShipmentSetOrderTrue() {
> + /* Test Invoice Per Shipment
> + Step 1) Create order and set invoicePerShipment=Y
> + Step 2) Pack Shipment For Ship Group.
> + Step 3) Check invoice should be created.
> + */
> + List invoices = testInvoicePerShipment('GZ-2644', 'Y')
> + assert UtilValidate.isNotEmpty(invoices)
> + }
> +
> + private List testInvoicePerShipment(String productId, String invoicePerShipment) {
> MockHttpServletRequest request = new MockHttpServletRequest()
> MockHttpServletResponse response = new MockHttpServletResponse()
>
> Security security = SecurityFactory.getInstance(delegator)
> - request.setAttribute("security", security)
> - request.setAttribute("delegator", delegator)
> - request.setAttribute("dispatcher", dispatcher)
> + request.setAttribute('security', security)
> + request.setAttribute('delegator', delegator)
> + request.setAttribute('dispatcher', dispatcher)
> HttpSession session = request.getSession()
> - session.setAttribute("orderMode", null)
> + session.setAttribute('orderMode', null)
>
> String result = ShoppingCartEvents.routeOrderEntry(request, response)
> - logInfo("===== >>> Event : routeOrderEntry, Response : " + result)
> + logInfo('===== >>> Event : routeOrderEntry, Response : ' + result)
>
> - request.setParameter("orderMode", "SALES_ORDER")
> - request.setParameter("productStoreId", "9000")
> - request.setParameter("partyId", "DemoCustomer")
> - request.setParameter("currencyUom", "USD")
> - session.setAttribute("userLogin", userLogin)
> + request.setParameter('orderMode', 'SALES_ORDER')
> + request.setParameter('productStoreId', '9000')
> + request.setParameter('partyId', 'DemoCustomer')
> + request.setParameter('currencyUom', 'USD')
> + session.setAttribute('userLogin', userLogin)
>
> result = ShoppingCartEvents.initializeOrderEntry(request, response)
> - logInfo("===== >>> Event : initializeOrderEntry, Response : " + result)
> + logInfo('===== >>> Event : initializeOrderEntry, Response : ' + result)
>
> result = ShoppingCartEvents.setOrderCurrencyAgreementShipDates(request, response)
> - logInfo("===== >>> Event : setOrderCurrencyAgreementShipDates, Response : " + result)
> + logInfo('===== >>> Event : setOrderCurrencyAgreementShipDates, Response : ' + result)
>
> - request.setParameter("add_product_id", productId)
> + request.setParameter('add_product_id', productId)
>
> result = ShoppingCartEvents.addToCart(request, response)
> - logInfo("===== >>> Event : addToCart, Response : " + result)
> + logInfo('===== >>> Event : addToCart, Response : ' + result)
>
> - request.setParameter("checkoutpage", "quick")
> - request.setParameter("shipping_contact_mech_id", "9015")
> - request.setParameter("shipping_method", "GROUND@UPS")
> - request.setParameter("checkOutPaymentId", "EXT_COD")
> - request.setParameter("is_gift", "false")
> - request.setParameter("may_split", "false")
> - request.setAttribute("shoppingCart", null)
> + request.setParameter('checkoutpage', 'quick')
> + request.setParameter('shipping_contact_mech_id', '9015')
> + request.setParameter('shipping_method', 'GROUND@UPS')
> + request.setParameter('checkOutPaymentId', 'EXT_COD')
> + request.setParameter('is_gift', 'false')
> + request.setParameter('may_split', 'false')
> + request.setAttribute('shoppingCart', null)
>
> result = CheckOutEvents.setQuickCheckOutOptions(request, response)
> - logInfo("===== >>> Event : setQuickCheckOutOptions, Response : " + result)
> + logInfo('===== >>> Event : setQuickCheckOutOptions, Response : ' + result)
>
> result = CheckOutEvents.createOrder(request, response)
> - logInfo("===== >>> Event : createOrder, Response : " + result)
> + logInfo('===== >>> Event : createOrder, Response : ' + result)
>
> result = CheckOutEvents.processPayment(request, response)
> - logInfo("===== >>> Event : processPayment, Response : " + result)
> + logInfo('===== >>> Event : processPayment, Response : ' + result)
>
> - dispatcher.runAsync("sendOrderConfirmation", null)
> + dispatcher.runAsync('sendOrderConfirmation', null)
>
> result = ShoppingCartEvents.destroyCart(request, response)
> - logInfo("===== >>> Event : destroyCart, Response = " + result)
> + logInfo('===== >>> Event : destroyCart, Response = ' + result)
>
> // Step 3
> - GenericValue orderHeader = from("OrderHeader").where("orderTypeId", "SALES_ORDER").orderBy("-entryDate").queryFirst()
> - logInfo("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx : " + orderHeader)
> + GenericValue orderHeader = from('OrderHeader').where('orderTypeId', 'SALES_ORDER').orderBy('-entryDate').queryFirst()
> + logInfo('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx : ' + orderHeader)
>
> if (invoicePerShipment) {
> // if this value is available that means we need to set this on the order
> Map orderInput = [:]
> orderInput.orderId = orderHeader.orderId
> orderInput.invoicePerShipment = invoicePerShipment
> orderInput.userLogin = userLogin
> - Map serviceResult = dispatcher.runSync("updateOrderHeader", orderInput)
> - logInfo("===== >>> Service : updateOrderHeader / invoicePerShipment = N, Response = " + serviceResult.responseMessage)
> + Map serviceResult = dispatcher.runSync('updateOrderHeader', orderInput)
> + logInfo('===== >>> Service : updateOrderHeader / invoicePerShipment = N, Response = ' + serviceResult.responseMessage)
> }
>
> PackingSession packingSession = new PackingSession(dispatcher, userLogin)
> - session.setAttribute("packingSession", packingSession)
> + session.setAttribute('packingSession', packingSession)
> packingSession.setPrimaryOrderId(orderHeader.orderId)
> - packingSession.setPrimaryShipGroupSeqId("00001")
> -
> - Map packInput = [:]
> - packInput.orderId = orderHeader.orderId
> - packInput.shipGroupSeqId = "00001"
> - packInput.packingSession = packingSession
> - packInput.nextPackageSeq = 1
> - packInput.userLogin = userLogin
> -
> - // Items
> - packInput.selInfo = [_1: "Y"]
> - packInput.pkgInfo = [_1: "1"]
> - packInput.qtyInfo = [_1: "1"]
> - packInput.prdInfo = [_1: productId]
> - packInput.iteInfo = [_1: "00001"]
> - packInput.wgtInfo = [_1: "0"]
> - packInput.numPackagesInfo = [_1: "1"]
> -
> - Map serviceResult = dispatcher.runSync("packBulkItems", packInput)
> + packingSession.setPrimaryShipGroupSeqId('00001')
> +
> + Map packInput = [
> + orderId: orderHeader.orderId,
> + shipGroupSeqId: '00001',
> + packingSession: packingSession,
> + nextPackageSeq: 1,
> + userLogin: userLogin,
> + selInfo: [_1: 'Y'],
> + pkgInfo: [_1: '1'],
> + qtyInfo: [_1: '1'],
> + prdInfo: [_1: productId],
> + iteInfo: [_1: '00001'],
> + wgtInfo: [_1: '0'],
> + numPackagesInfo: [_1: '1']
> + ]
> +
> + Map serviceResult = dispatcher.runSync('packBulkItems', packInput)
> assert ServiceUtil.isSuccess(serviceResult)
> - logInfo("===== >>> Service: packBulkItems, Response = " + serviceResult.responseMessage)
> + logInfo('===== >>> Service: packBulkItems, Response = ' + serviceResult.responseMessage)
>
> - Map completePackInput = dispatcher.getDispatchContext().makeValidContext("completePack", ModelService.IN_PARAM, packInput)
> - serviceResult = dispatcher.runSync("completePack", completePackInput)
> + Map completePackInput = dispatcher.getDispatchContext().makeValidContext('completePack', ModelService.IN_PARAM, packInput)
> + serviceResult = dispatcher.runSync('completePack', completePackInput)
> assert ServiceUtil.isSuccess(serviceResult)
> - logInfo("===== >>> Service: completePack, shipmentId = " + serviceResult.shipmentId)
> + logInfo('===== >>> Service: completePack, shipmentId = ' + serviceResult.shipmentId)
>
> // Step 4
> - List invoices = from("OrderItemBillingAndInvoiceAndItem").where("orderId", orderHeader.orderId).queryList()
> + List invoices = from('OrderItemBillingAndInvoiceAndItem').where('orderId', orderHeader.orderId).queryList()
> return invoices
> }
>
> Review Comment:
> I see no reasons to remove the tests below. I can see them ran at https://nightlies.apache.org/ofbiz/trunk/tests-results/plugins/html/
>
>
>
[GitHub] [ofbiz-framework] JacquesLeRoux commented on a diff in pull request #517: Codenarc integration
Posted by "JacquesLeRoux (via GitHub)" <gi...@apache.org>.
JacquesLeRoux commented on code in PR #517:
URL: https://github.com/apache/ofbiz-framework/pull/517#discussion_r1135270359
##########
applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/InvoicePerShipmentTests.groovy:
##########
@@ -34,152 +31,155 @@ import org.apache.ofbiz.shipment.packing.PackingSession
import org.springframework.mock.web.MockHttpServletRequest
import org.springframework.mock.web.MockHttpServletResponse
+import javax.servlet.http.HttpSession
-public class InvoicePerShipmentTests extends OFBizTestCase {
- public InvoicePerShipmentTests(String name) {
+class InvoicePerShipmentTests extends OFBizTestCase {
+
+ InvoicePerShipmentTests(String name) {
super(name)
}
- def testInvoicePerShipment(String productId, String invoicePerShipment) {
+ void testInvoicePerShipmentSetFalse() {
+ /* Test Invoice Per Shipment
+ Step 1) Set create.invoice.per.shipment=N in accounting.properties file.
+ Step 2) Create order and approve order.
+ Step 3) Pack Shipment For Ship Group.
+ Step 4) Check invoice should not created.
+ */
+ List invoices = testInvoicePerShipment('GZ-1000', 'N')
+ assert UtilValidate.isEmpty(invoices)
+ }
+
+ void testInvoicePerShipmentSetTrue() {
+ /* Test Invoice Per Shipment
+ Step 1) Set create.invoice.per.shipment=Y in accounting.properties file.
+ Step 2) Create order and approve order.
+ Step 3) Pack Shipment For Ship Group.
+ Step 4) Check invoice should be created.
+ */
+ List invoices = testInvoicePerShipment('GZ-1000', 'Y')
+ assert UtilValidate.isNotEmpty(invoices)
+ }
+
+ void testInvoicePerShipmentSetOrderFalse() {
+ /* Test Invoice Per Shipment
+ Step 1) Create order and set invoicePerShipment=N.
+ Step 2) Pack Shipment For Ship Group.
+ Step 3) Check invoice should not be created.
+ */
+ List invoices = testInvoicePerShipment('GZ-2644', 'N')
+ assert UtilValidate.isEmpty(invoices)
+ }
+
+ void testInvoicePerShipmentSetOrderTrue() {
+ /* Test Invoice Per Shipment
+ Step 1) Create order and set invoicePerShipment=Y
+ Step 2) Pack Shipment For Ship Group.
+ Step 3) Check invoice should be created.
+ */
+ List invoices = testInvoicePerShipment('GZ-2644', 'Y')
+ assert UtilValidate.isNotEmpty(invoices)
+ }
+
+ private List testInvoicePerShipment(String productId, String invoicePerShipment) {
MockHttpServletRequest request = new MockHttpServletRequest()
MockHttpServletResponse response = new MockHttpServletResponse()
Security security = SecurityFactory.getInstance(delegator)
- request.setAttribute("security", security)
- request.setAttribute("delegator", delegator)
- request.setAttribute("dispatcher", dispatcher)
+ request.setAttribute('security', security)
+ request.setAttribute('delegator', delegator)
+ request.setAttribute('dispatcher', dispatcher)
HttpSession session = request.getSession()
- session.setAttribute("orderMode", null)
+ session.setAttribute('orderMode', null)
String result = ShoppingCartEvents.routeOrderEntry(request, response)
- logInfo("===== >>> Event : routeOrderEntry, Response : " + result)
+ logInfo('===== >>> Event : routeOrderEntry, Response : ' + result)
- request.setParameter("orderMode", "SALES_ORDER")
- request.setParameter("productStoreId", "9000")
- request.setParameter("partyId", "DemoCustomer")
- request.setParameter("currencyUom", "USD")
- session.setAttribute("userLogin", userLogin)
+ request.setParameter('orderMode', 'SALES_ORDER')
+ request.setParameter('productStoreId', '9000')
+ request.setParameter('partyId', 'DemoCustomer')
+ request.setParameter('currencyUom', 'USD')
+ session.setAttribute('userLogin', userLogin)
result = ShoppingCartEvents.initializeOrderEntry(request, response)
- logInfo("===== >>> Event : initializeOrderEntry, Response : " + result)
+ logInfo('===== >>> Event : initializeOrderEntry, Response : ' + result)
result = ShoppingCartEvents.setOrderCurrencyAgreementShipDates(request, response)
- logInfo("===== >>> Event : setOrderCurrencyAgreementShipDates, Response : " + result)
+ logInfo('===== >>> Event : setOrderCurrencyAgreementShipDates, Response : ' + result)
- request.setParameter("add_product_id", productId)
+ request.setParameter('add_product_id', productId)
result = ShoppingCartEvents.addToCart(request, response)
- logInfo("===== >>> Event : addToCart, Response : " + result)
+ logInfo('===== >>> Event : addToCart, Response : ' + result)
- request.setParameter("checkoutpage", "quick")
- request.setParameter("shipping_contact_mech_id", "9015")
- request.setParameter("shipping_method", "GROUND@UPS")
- request.setParameter("checkOutPaymentId", "EXT_COD")
- request.setParameter("is_gift", "false")
- request.setParameter("may_split", "false")
- request.setAttribute("shoppingCart", null)
+ request.setParameter('checkoutpage', 'quick')
+ request.setParameter('shipping_contact_mech_id', '9015')
+ request.setParameter('shipping_method', 'GROUND@UPS')
+ request.setParameter('checkOutPaymentId', 'EXT_COD')
+ request.setParameter('is_gift', 'false')
+ request.setParameter('may_split', 'false')
+ request.setAttribute('shoppingCart', null)
result = CheckOutEvents.setQuickCheckOutOptions(request, response)
- logInfo("===== >>> Event : setQuickCheckOutOptions, Response : " + result)
+ logInfo('===== >>> Event : setQuickCheckOutOptions, Response : ' + result)
result = CheckOutEvents.createOrder(request, response)
- logInfo("===== >>> Event : createOrder, Response : " + result)
+ logInfo('===== >>> Event : createOrder, Response : ' + result)
result = CheckOutEvents.processPayment(request, response)
- logInfo("===== >>> Event : processPayment, Response : " + result)
+ logInfo('===== >>> Event : processPayment, Response : ' + result)
- dispatcher.runAsync("sendOrderConfirmation", null)
+ dispatcher.runAsync('sendOrderConfirmation', null)
result = ShoppingCartEvents.destroyCart(request, response)
- logInfo("===== >>> Event : destroyCart, Response = " + result)
+ logInfo('===== >>> Event : destroyCart, Response = ' + result)
// Step 3
- GenericValue orderHeader = from("OrderHeader").where("orderTypeId", "SALES_ORDER").orderBy("-entryDate").queryFirst()
- logInfo("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx : " + orderHeader)
+ GenericValue orderHeader = from('OrderHeader').where('orderTypeId', 'SALES_ORDER').orderBy('-entryDate').queryFirst()
+ logInfo('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx : ' + orderHeader)
if (invoicePerShipment) {
// if this value is available that means we need to set this on the order
Map orderInput = [:]
orderInput.orderId = orderHeader.orderId
orderInput.invoicePerShipment = invoicePerShipment
orderInput.userLogin = userLogin
- Map serviceResult = dispatcher.runSync("updateOrderHeader", orderInput)
- logInfo("===== >>> Service : updateOrderHeader / invoicePerShipment = N, Response = " + serviceResult.responseMessage)
+ Map serviceResult = dispatcher.runSync('updateOrderHeader', orderInput)
+ logInfo('===== >>> Service : updateOrderHeader / invoicePerShipment = N, Response = ' + serviceResult.responseMessage)
}
PackingSession packingSession = new PackingSession(dispatcher, userLogin)
- session.setAttribute("packingSession", packingSession)
+ session.setAttribute('packingSession', packingSession)
packingSession.setPrimaryOrderId(orderHeader.orderId)
- packingSession.setPrimaryShipGroupSeqId("00001")
-
- Map packInput = [:]
- packInput.orderId = orderHeader.orderId
- packInput.shipGroupSeqId = "00001"
- packInput.packingSession = packingSession
- packInput.nextPackageSeq = 1
- packInput.userLogin = userLogin
-
- // Items
- packInput.selInfo = [_1: "Y"]
- packInput.pkgInfo = [_1: "1"]
- packInput.qtyInfo = [_1: "1"]
- packInput.prdInfo = [_1: productId]
- packInput.iteInfo = [_1: "00001"]
- packInput.wgtInfo = [_1: "0"]
- packInput.numPackagesInfo = [_1: "1"]
-
- Map serviceResult = dispatcher.runSync("packBulkItems", packInput)
+ packingSession.setPrimaryShipGroupSeqId('00001')
+
+ Map packInput = [
+ orderId: orderHeader.orderId,
+ shipGroupSeqId: '00001',
+ packingSession: packingSession,
+ nextPackageSeq: 1,
+ userLogin: userLogin,
+ selInfo: [_1: 'Y'],
+ pkgInfo: [_1: '1'],
+ qtyInfo: [_1: '1'],
+ prdInfo: [_1: productId],
+ iteInfo: [_1: '00001'],
+ wgtInfo: [_1: '0'],
+ numPackagesInfo: [_1: '1']
+ ]
+
+ Map serviceResult = dispatcher.runSync('packBulkItems', packInput)
assert ServiceUtil.isSuccess(serviceResult)
- logInfo("===== >>> Service: packBulkItems, Response = " + serviceResult.responseMessage)
+ logInfo('===== >>> Service: packBulkItems, Response = ' + serviceResult.responseMessage)
- Map completePackInput = dispatcher.getDispatchContext().makeValidContext("completePack", ModelService.IN_PARAM, packInput)
- serviceResult = dispatcher.runSync("completePack", completePackInput)
+ Map completePackInput = dispatcher.getDispatchContext().makeValidContext('completePack', ModelService.IN_PARAM, packInput)
+ serviceResult = dispatcher.runSync('completePack', completePackInput)
assert ServiceUtil.isSuccess(serviceResult)
- logInfo("===== >>> Service: completePack, shipmentId = " + serviceResult.shipmentId)
+ logInfo('===== >>> Service: completePack, shipmentId = ' + serviceResult.shipmentId)
// Step 4
- List invoices = from("OrderItemBillingAndInvoiceAndItem").where("orderId", orderHeader.orderId).queryList()
+ List invoices = from('OrderItemBillingAndInvoiceAndItem').where('orderId', orderHeader.orderId).queryList()
return invoices
}
Review Comment:
I see no reasons to remove the tests below. I can see them ran at https://nightlies.apache.org/ofbiz/trunk/tests-results/plugins/html/
--
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