[jira] [Commented] (OFBIZ-11167) Use Codenarc to test Groovy code

2022-07-03 Thread Gil Portenseigne (Jira)


[ 
https://issues.apache.org/jira/browse/OFBIZ-11167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17561935#comment-17561935
 ] 

Gil Portenseigne commented on OFBIZ-11167:
--

I wrote a little script to extract the rules in order of occurrence. I will 
launch an email to the dev list to discuss about the rules to be respected, and 
the implied changes.

There are the results :
||Number of occurence||Rule name and details||
|9883|UnnecessaryGString - String objects should be created with single quotes, 
and GString objects created with double quotes. Creating normal String objects 
with double quotes is confusing to readers.|
|4569|DuplicateStringLiteral - Code containing duplicate String literals can 
usually be improved by declaring the String as a constant field. The 
ignoreStrings property () can optionally specify a comma-separated list of 
Strings to ignore.|
|4209|SpaceAroundMapEntryColon - Check for configured formatting of whitespace 
around colons for literal Map entries. The characterBeforeColonRegex and 
characterAfterColonRegex properties specify a regular expression that must 
match the character before/after the colon.|
|1448|LineLength - Checks the maximum length for each line of source code. It 
checks for number of characters, so lines that include tabs may appear longer 
than the allowed number when viewing the file. The maximum line length can be 
configured by setting the length property, which defaults to 120.|
|885|UnnecessaryGetter - Checks for explicit calls to getter/accessor methods 
which can, for the most part, be replaced by property access. A getter is 
defined as a method call that matches get[A-Z] but not getClass() or 
get[A-Z][A-Z] such as getURL(). Getters do not take method arguments. The 
ignoreMethodNames property (null) can specify method names that should be 
ignored, optionally containing wildcard characters ('*' or '?').|
|601|NoDef - def should not be used. You should replace it with concrete type.|
|485|MethodReturnTypeRequired - Checks that method return types are not 
dynamic, that is they are explicitly stated and different than def.|
|484|Indentation - Check indentation for class and method declarations, and 
initial statements.|
|482|UnnecessaryReturnKeyword - In Groovy, the return keyword is often 
optional. If a statement is the last line in a method or closure then you do 
not need to have the return keyword.|
|407|UnnecessaryObjectReferences - Violations are triggered when an excessive 
set of consecutive statements all reference the same variable. This can be made 
more readable by using a with or identity block.|
|345|CompileStatic - Check that classes are explicitely annotated with either 
@GrailsCompileStatic, @CompileStatic or @CompileDynamic|
|320|ExplicitCallToEqualsMethod - This rule detects when the equals(Object) 
method is called directly in code instead of using the == or != operator. A 
groovier way to express this: a.equals(b) is this: a == b and a groovier way to 
express : !a.equals(b) is : a != b|
|235|IfStatementBraces - Use braces for if statements, even for a single 
statement.|
|235|SpaceAroundOperator - Check that there is at least one space (blank) or 
whitespace around each binary operator.|
|211|NestedBlockDepth - Checks for blocks or closures nested more than 
maxNestedBlockDepth (5) levels deep.|
|201|TrailingWhitespace - Checks that no lines of source code end with 
whitespace characters.|
|190|DuplicateNumberLiteral - Code containing number String literals can 
usually be improved by declaring the number as a constant field. The 
ignoreNumbers property (0,1) can optionally specify a comma-separated list of 
numbers to ignore.|
|190|NoWildcardImports - Wildcard imports, static or otherwise, should not be 
used.|
|173|TrailingComma - Check whether list and map literals contain optional 
trailing comma.|
|167|InvertedCondition - An inverted condition is one where a constant 
expression is used on the left hand side of the equals comparision. Such 
conditions can be confusing especially when used in assertions where the 
expected value is by convention placed on the right hand side of the 
comparision.|
|167|JavadocEmptyReturnTag - Checks for empty @return tags within javadoc.|
|164|UnnecessarySetter - Checks for explicit calls to setter methods which can, 
for the most part, be replaced by assignment to property. A setter is defined 
as a method call that matches set[A-Z] but not set[A-Z][A-Z] such as setURL(). 
Setters take one method argument.|
|146|CouldBeElvis - Catch an if block that could be written as an elvis 
expression.|
|142|UnusedImport - Imports for a class that is never referenced within the 
source file is unnecessary.|
|141|AbcMetric - Checks the ABC size metric for methods/classes. A method (or 
"closure field") with an ABC score greater than the maxMethodAbcScore property 
(60) causes a violation. Likewise, a class that has an (average 

[GitHub] [ofbiz-framework] sonarcloud[bot] commented on pull request #517: Codenarc integration

2022-07-03 Thread GitBox


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=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=517=false=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=517=false=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework=517=false=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=517=false=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=517=false=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework=517=false=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=517=false=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=517=false=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_ofbiz-framework=517=false=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=517=false=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=517=false=CODE_SMELL)
 [0 Code 
Smells](https://sonarcloud.io/project/issues?id=apache_ofbiz-framework=517=false=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=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=517=new_duplicated_lines_density=list)
 [9.4% 
Duplication](https://sonarcloud.io/component_measures?id=apache_ofbiz-framework=517=new_duplicated_lines_density=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-unsubscr...@ofbiz.apache.org

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



[GitHub] [ofbiz-framework]: Workflow run "Java CI with Gradle" failed!

2022-07-03 Thread GitBox


The GitHub Actions job "Java CI with Gradle" on ofbiz-framework.git has failed.
Run started by GitHub user gilPts (triggered by gilPts).

Head commit for run:
156881ee4e9df7dc13cbb0937f2115d52d2783b9 / Gil Portenseigne 
Add groovy parser script to get infracted rules ordered by number of occurence.

Report URL: https://github.com/apache/ofbiz-framework/actions/runs/2606238725

With regards,
GitHub Actions via GitBox