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

[Hackaton 2024][Rhodium-Antimoine][PYTHON] Avoid Double Quote Check #115

Open
AntoineMeheut opened this issue May 30, 2024 · 0 comments
Open
Assignees
Labels
checkers Hackathon 2024 New issues tagged during the hackathon 2024

Comments

@AntoineMeheut
Copy link
Contributor

AntoineMeheut commented May 30, 2024

Associated rule title

[PYTHON] Avoid Double Quote Check

Associated rule link

https://github.com/green-code-initiative/ecoCode/blob/main/ecocode-rules-specifications/src/main/rules/EC66/python/EC66.asciidoc

Language and platform

Example: Python

Itel proc 12th Gen Core i7-1255U 1,7 GHz

Docker container : python:3.9-slim

memory = 4go

swap = 6go

cpu=2

Measure justification

Profiling with psutil directly in code

Reading RAM and CPU used

Completion of 50 000 000 cycles to amplify impacts

Application of the formula for calculating the CO2 equivalent present on this url: https://boavizta.org/blog/empreinte-de-la-fabrication-d-un-serveur
servermanufgwp(kgCO2eq) = servertypegwp(kgCO2eq) + cpuunits(unit) x cpubasegwp(kgCO2eq/unit) + ramsize(GB) x ramsizegwp(kgCO2eq/GB)

Calculating the differential between code implementing bad code and code implementing good code practice

Validation

The rule is not really validated by the measurement.

Link to the code used to validate the rule: https://github.com/JulienPlanque/python-profiling

Validation result
Lancement du conteneur pour le script avoidDoubleQuoteCheckBad.py...
4478091441.0
Lancement du conteneur pour le script avoidDoubleQuoteCheckGood.py...
4478091411.0
Calculation of deltas:

Delta between bad practice and good code practice for rule AvoidListComprehensionInIterations: 30

@AntoineMeheut AntoineMeheut added checkers Hackathon 2024 New issues tagged during the hackathon 2024 labels May 30, 2024
@AntoineMeheut AntoineMeheut changed the title [Hackaton 2024][Rhodium-Antimoine][PYTHON] Avoid Double Quote Check Bad [Hackaton 2024][Rhodium-Antimoine][PYTHON] Avoid Double Quote Check May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
checkers Hackathon 2024 New issues tagged during the hackathon 2024
Projects
None yet
Development

No branches or pull requests

2 participants