Clean up code smells: remove empty statements and commented code#377
Open
sonarqube-agent[bot] wants to merge 1 commit into
Open
Clean up code smells: remove empty statements and commented code#377sonarqube-agent[bot] wants to merge 1 commit into
sonarqube-agent[bot] wants to merge 1 commit into
Conversation
Fixed issues: - AZggACkKxdvKFWvLKU7K for java:S1116 rule - AZggADLvxdvKFWvLKVCQ for java:S125 rule Generated by SonarQube Agent (task: 51fe1438-4214-4d81-89b3-a43645e95afe)
zglicz
approved these changes
Jun 12, 2026
zglicz
left a comment
Contributor
There was a problem hiding this comment.
Auto-approved: SonarQube automated remediation.
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.
This PR resolves 2 SonarQube code smells by removing an unnecessary empty statement (double semicolon) and deleting commented-out code that adds no value. These cleanup changes improve code clarity and reduce noise in the codebase.
View Project in SonarCloud
Fixed Issues
java:S1116 - Remove this empty statement. • MINOR • View issue
Location:
flex-checks/src/test/java/org/sonar/flex/checks/FunctionNameCheckTest.java:28Why is this an issue?
Empty statements represented by a semicolon
;are statements that do not perform any operation. They are often the result of a typo or a misunderstanding of the language syntax. It is a good practice to remove empty statements since they don’t add value and lead to confusion and errors.What changed
This hunk removes the extra semicolon (empty statement) at the end of the FlexVerifier.verify() call on line 28. The original code had a double semicolon ';;' which constitutes an empty statement after the method call. By changing it to a single semicolon, the empty statement is eliminated, resolving the code smell.
java:S125 - This block of commented-out lines of code should be removed. • MAJOR • View issue
Location:
its/plugin/src/test/java/com/sonar/it/flex/FlexSimpleProjectTest.java:65Why is this an issue?
Commented-out code distracts the focus from the actual executed code. It creates a noise that increases maintenance code. And because it is never executed, it quickly becomes out of date and invalid.
What changed
This hunk removes the commented-out line of code
assertThat(getFileMeasure(PROJECT + ":same_name/XMLUtil.mxml", "ncloc").getIntValue(), is(12));and replaces it with a blank comment. This addresses the code smell about commented-out code that should be removed, as it creates noise and distracts from actual executed code. The commented-out assertion is deleted, leaving only a blank comment placeholder.SonarQube Remediation Agent uses AI. Check for mistakes.