[ https://issues.apache.org/jira/browse/GROOVY-10683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17939522#comment-17939522 ]
ASF GitHub Bot commented on GROOVY-10683: ----------------------------------------- codecov-commenter commented on PR #2169: URL: https://github.com/apache/groovy/pull/2169#issuecomment-2764891027 ## [Codecov](https://app.codecov.io/gh/apache/groovy/pull/2169?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report Attention: Patch coverage is `73.07692%` with `21 lines` in your changes missing coverage. Please review. > Project coverage is 68.8378%. Comparing base [(`6ce967f`)](https://app.codecov.io/gh/apache/groovy/commit/6ce967f8019f175e589e71873f025b0a16bb0a13?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`4619471`)](https://app.codecov.io/gh/apache/groovy/commit/4619471d9011e9879b44b48d463bdfa3dbd0cc21?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache). | [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2169?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines | |---|---|---| | [...ehaus/groovy/classgen/ClassCompletionVerifier.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2FClassCompletionVerifier.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL0NsYXNzQ29tcGxldGlvblZlcmlmaWVyLmphdmE=) | 68.1818% | [5 Missing and 9 partials :warning: ](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | | [...va/org/apache/groovy/parser/antlr4/AstBuilder.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fapache%2Fgroovy%2Fparser%2Fantlr4%2FAstBuilder.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dyb292eS9wYXJzZXIvYW50bHI0L0FzdEJ1aWxkZXIuamF2YQ==) | 69.5652% | [5 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | <details><summary>Additional details and impacted files</summary> [](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) ```diff @@ Coverage Diff @@ ## master #2169 +/- ## ================================================== - Coverage 68.8443% 68.8378% -0.0065% - Complexity 29533 29550 +17 ================================================== Files 1421 1421 Lines 113424 113458 +34 Branches 19644 19672 +28 ================================================== + Hits 78086 78102 +16 - Misses 28754 28765 +11 - Partials 6584 6591 +7 ``` | [Files with missing lines](https://app.codecov.io/gh/apache/groovy/pull/2169?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | |---|---|---| | [...ava/org/codehaus/groovy/ast/stmt/ForStatement.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fast%2Fstmt%2FForStatement.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2FzdC9zdG10L0ZvclN0YXRlbWVudC5qYXZh) | `100.0000% <100.0000%> (ø)` | | | [...va/org/apache/groovy/parser/antlr4/AstBuilder.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fapache%2Fgroovy%2Fparser%2Fantlr4%2FAstBuilder.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2dyb292eS9wYXJzZXIvYW50bHI0L0FzdEJ1aWxkZXIuamF2YQ==) | `86.3556% <69.5652%> (-0.2695%)` | :arrow_down: | | [...ehaus/groovy/classgen/ClassCompletionVerifier.java](https://app.codecov.io/gh/apache/groovy/pull/2169?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Forg%2Fcodehaus%2Fgroovy%2Fclassgen%2FClassCompletionVerifier.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3JjL21haW4vamF2YS9vcmcvY29kZWhhdXMvZ3Jvb3Z5L2NsYXNzZ2VuL0NsYXNzQ29tcGxldGlvblZlcmlmaWVyLmphdmE=) | `84.2402% <68.1818%> (-0.9377%)` | :arrow_down: | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/apache/groovy/pull/2169/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) </details> <details><summary> :rocket: New features to boost your workflow: </summary> - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems. - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges. </details> > Consider enhancing for loop to provide access to loop index or iterator > ----------------------------------------------------------------------- > > Key: GROOVY-10683 > URL: https://issues.apache.org/jira/browse/GROOVY-10683 > Project: Groovy > Issue Type: New Feature > Components: parser-antlr4 > Reporter: Eric Milles > Priority: Minor > > When iterating over an array or iterable, there is choice between traditional > counting loop for index access, declaring/managing an external variable to > leverage for-each loop, or switching to {{eachWithIndex}} which requires > quite a bit more runtime investment. > {code:groovy} > for (int i = 0, n = array.length; i < n; i += 1) { > def val = array[i] > } > int idx = 0; for (val in array) { > idx += 1; > } > // idiomatic and takes care of all the management, but lacks STC support for > primitive arrays and adds the cost of method invocation for each iteration > array.eachWithIndex { val, idx -> > } > {code} > Please consider the possibility of {{for}} loop enhancements of > [Gosu|https://gosu-lang.github.io/docs.html], which provides a direct syntax > for index or iterator: > {code} > for (val in array index idx) { > println "$idx: $val" > } > for (value in iterable iterator iter) { // could be ListIterator for List > types, which increases options > iter.remove() // for example > } > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)