-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new rule EC31: Prefer lighter formats for image files #52
base: main
Are you sure you want to change the base?
Add new rule EC31: Prefer lighter formats for image files #52
Conversation
4a61b04
to
b69c5f3
Compare
|
||
### Deleted | ||
## [1.6.2] - 2024-05-30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you add this section title ?
please remove it and let your new line added under "Unreleased" section
import org.sonar.api.utils.log.Loggers; | ||
|
||
@Rule(key = "EC31") | ||
@DeprecatedRuleKey(repositoryKey = "greencodeinitiative-java", ruleKey = "EC31") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you add this line ?
if (tree.is(Tree.Kind.STRING_LITERAL)) { | ||
LiteralTree literalTree = (LiteralTree) tree; | ||
String value = literalTree.value(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
her, you can "return" empty if your string length is not > 6 (because the minimum length is 7 for your image name is : "a.png"
thus no need to execute the next if and the next for of the algorithm, for nothing.
public PreferLighterImageFormatsCheck(PreferLighterImageFormatsCheck checker) { | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a use case test with my review feedback above => no need to check if string length isn't > 6
This PR has been automatically marked as stale because it has no activity for 30 days. |
No description provided.