Remove unused pushedManifest local variable in CopyUtils#1
Open
sonarqube-agent[bot] wants to merge 1 commit into
Open
Remove unused pushedManifest local variable in CopyUtils#1sonarqube-agent[bot] wants to merge 1 commit into
sonarqube-agent[bot] wants to merge 1 commit into
Conversation
Fixed issues: - AZ6wRBfVQw83x_y7ZeMC for java:S1481 rule Generated by SonarQube Agent (task: 57d776ba-dfc2-4383-a395-f7fb0c9d6f79)
|
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 an unused local variable declaration in CopyUtils.java that was capturing the return value from pushManifest() without ever being referenced. The method call is still executed for its side effects, eliminating the code smell while maintaining the same functionality.
View Project in SonarCloud
Fixed Issues
java:S1481 - Remove this unused "pushedManifest" local variable. • MINOR • View issue
Location:
src/main/java/land/oras/CopyUtils.java:244Why is this an issue?
An unused local variable is a variable that has been declared but is not used anywhere in the block of code where it is defined. It is dead code, contributing to unnecessary complexity and leading to confusion when reading the code. Therefore, it should be removed from your code to maintain clarity and efficiency.
What changed
This hunk removes the unused local variable 'pushedManifest' by changing the assignment statement 'Manifest pushedManifest = target.pushManifest(' to just 'target.pushManifest('. The method call is still executed for its side effects, but the return value is no longer captured in a variable that was never used, eliminating the unused local variable code smell.
SonarQube Remediation Agent uses AI. Check for mistakes.