Skip to content
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

Resolve issue CRJVM204 [Team 1.5] #153

Conversation

nouk-pl
Copy link

@nouk-pl nouk-pl commented Apr 6, 2023

Resolved issue CRJVM204

Summary

Because SVGs are generally smaller than other image format, they’re less taxing on your server despite needing to render on load. So we recommended, when it is possible, to use svg format image over other image format.

SVG are vector image, they can be compress without any loss, witch means that they're compressible to smaller file sizes at no cost to their definition, detail, or quality. PNGs also benefit from lossless compression of 5-20%, which can help make up for their large file size. However, they're still likely to be larger than an SVG.

SVGs are also scalable and will render pixel-perfect at any resolution whereas JPEGs, PNGs and GIFs will not.

How it work ?

To check if a not recommended image format are used in Java code, we check string literal to verify if a not recommended extension is used. If so, an issue is raised.

On SonarQube

The render of an issue explanation :

image

@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

92.3% 92.3% Coverage
0.0% 0.0% Duplication

@nouk-pl nouk-pl changed the title Resolve issue CRJVM204 Resolve issue CRJVM204 [Team 1.5] Apr 6, 2023
@MP-Aubay
Copy link
Contributor

MP-Aubay commented Apr 7, 2023

Issue #105

@MP-Aubay MP-Aubay added 🗃️ rule rule improvment or rule development or bug java 🏆 challenge2023 🏆 Work done during the ecoCode Challenge 2023 labels Apr 7, 2023
@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 Jun 24, 2023
@dedece35
Copy link
Member

@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 Oct 23, 2023
@dedece35
Copy link
Member

HI @utarwyn, @jhertout, @glalloue,

what do you think about this PR ?
I have a doubt about implementation that constraints strongly the use of all image formats.

@dedece35
Copy link
Member

core-team decision : not applicable as described
argumentation to do by @jycr, please.

@jycr
Copy link
Contributor

jycr commented Dec 22, 2023

Sorry, I'm coming late to the discussion of this proposed rule.

Imposing SVG as the only valid format is not relevant.

Indeed, SVG can only be used for specific kind of images (those presenting drawings or solid colors: e.g. icons, logos).

A photographic illustration will be of much better quality for a lower size by remaining in a “bitmap” format (eg: JPG, WebP).
Vectorizing a bitmap image will degrade the quality and increase its weight.

Here is an example with the image used on the home page of https://www.greenpeace.fr/ :

Original Bitmap image in JPG (75 ko -> 73 ko through HTTP GZIP) :

Cheetah-Nathan-Moine-2-1600x900

Vectorized Image in SVG (2,3 Mo -> 1,9 Mo through HTTP GZIP) :

Cheetah-Nathan-Moine-2-1600x900

The context and applicability of this rule need to be much better clarified.
Based on the applicability criteria, we need to see if it is possible to automatically determine whether this rule can apply.
In any case, we should not apply this rule systematically

@dedece35
Copy link
Member

dedece35 commented Dec 22, 2023

PR (and linked issue) closed, for now, because not applicable like that : see explanation above.
Feel free to reopen linked issue and this PR once work done (measures, clarification).

@dedece35 dedece35 closed this Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗃️ rule rule improvment or rule development or bug 🏆 challenge2023 🏆 Work done during the ecoCode Challenge 2023 java
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants