SONARJAVA-6823: Implemented rule S909 "continue" should not be used - #5989
Conversation
…in loops Detect every use of the continue statement inside loops (for, for-each, while, do-while), whether labeled or unlabeled. The rule flags continue as a code smell that reduces readability — loops should use inverted conditional logic instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
|
❌ Ruling needs updating. A fix PR has been created: #5992 Please review and merge it into your branch. |
Ruling Diff SummaryDetected changes in 5 rule files: 0 issues removed, 383 issues added. S909 (
|
|
❌ Ruling needs updating. A fix PR has been created: #5994 Please review and merge it into your branch. |
Prompt: Add a test withoutSemantic for the new rule Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
❌ Ruling needs updating. A fix PR has been created: #5994 Please review and merge it into your branch. |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
❌ Ruling needs updating. A fix PR has been created: #6030 Please review and merge it into your branch. |
|
❌ Ruling needs updating. A fix PR has been created: #6032 Please review and merge it into your branch. |
…r-to-main The ruling expectation file was left behind when the rule key was renamed from S9356 to S909, causing the Ruling QA CI check to fail. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code Review ✅ Approved 2 resolved / 2 findingsImplements rule S9356 to flag 'continue' statements inside loops, addressing the duplicate sentence in the rule description and stale ruling expectations. ✅ 2 resolved✅ Quality: Duplicated sentence in S9356.html rule description
✅ Bug: Stale java-S9356.json ruling expectation left after rule key rename
Implementation Status ✅ 1 of 1 objectives covered✅ SONARJAVA-6823 - 1 of 1 objectives coveredThis PR covers the implementation of rule S909 'continue' should not be used in loops. ✅ 1 covered here
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|




Summary
continuestatement inside loops (for, for-each, while, do-while), whether labeled or unlabeledcontinueIssuableSubscriptionVisitorsubscribing toCONTINUE_STATEMENTTest plan
ContinueInLoopCheckTestpasses🤖 Generated with Claude Code