Skip to content

Conversation

@salah-dev-inp
Copy link

No description provided.

@salah-dev-inp salah-dev-inp force-pushed the EC31-prefer-lighter-formats-for-image-file branch from 4a61b04 to b69c5f3 Compare May 30, 2024 12:06
### Changed

### Deleted
## [1.6.2] - 2024-05-30
Copy link
Member

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")
Copy link
Member

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();

Copy link
Member

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) {
}


Copy link
Member

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

@github-actions
Copy link

This PR has been automatically marked as stale because it has no activity for 30 days.
Please add a comment if you want to keep the issue open. Thank you for your contributions!

@github-actions
Copy link

This PR has been automatically marked as stale because it has no activity for 30 days.
Please add a comment if you want to keep the issue open. Thank you for your contributions!

@github-actions github-actions bot added the stale label Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants