fix: remove labeled break statement in Enunciate loop#7
Open
sonarqube-agent[bot] wants to merge 1 commit intomasterfrom
Open
fix: remove labeled break statement in Enunciate loop#7sonarqube-agent[bot] wants to merge 1 commit intomasterfrom
sonarqube-agent[bot] wants to merge 1 commit intomasterfrom
Conversation
Fixed issues: - AZZmtiWq2HDYqP_XyoAq for java:S1119 rule Generated by SonarQube Agent (task: 8b16751b-10c3-4bb6-92ed-40050deb3172)
SonarQube reviewer guide
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Removes the COPY_LOOP label and refactors the nested loop logic to eliminate unnecessary labeled breaks, improving code readability and maintainability. Using labels in Java is considered an anti-pattern that obscures control flow and makes the code harder to understand.
View Project in SonarCloud
Fixed Issues
java:S1119 - Refactor the code to remove this label and the need for it. • MAJOR • View issue
Location:
core/src/main/java/com/webcohesion/enunciate/Enunciate.java:328Why is this an issue?
Labels are not commonly used in Java, and many developers do not understand how they work. Moreover, their usage makes the control flow harder to follow, which reduces the code’s readability.
What changed
Removes the
COPY_LOOP:label from the outer loop. This directly addresses the code smell about using labels in Java, which reduce readability and make control flow harder to follow.SonarQube Remediation Agent uses AI. Check for mistakes.