Our official website : https://ecosonar.org
User guide: https://github.com/Accenture/EcoSonar/blob/main/USER_GUIDE.md
The EcoSonar tool consists of:
A containerized Node.js API
Sonarqube plugins
Example of Architecture deployed on Azure:
To install EcoSonar locally, you have two options:
Run the following commands:
cd EcoSonar-SonarQube
export REACT_APP_BASE_URL_ECOSONAR_API=http://localhost:3000
mvn clean package -Durl=http://localhost:3000
cd ..
docker-compose build
docker-compose up
For specific details on Ecocode, please look at their GitHub repository: https://github.com/green-code-initiative/ecoCode .
You will find here https://github.com/Accenture/EcoSonar/tree/main/EcoSonar-SonarQube/ecocode
the EcoCode Sonarqube plugins that needs to be imported into your Sonarqube instance.
To install the ecocode plugins, please follow instruction from EcoSonar SonarQube plugin : https://github.com/Accenture/EcoSonar/blob/main/EcoSonar-SonarQube/README.md
When using Sonarqube as code analysis, a default Quality Profile is set up for each language. If you want to use EcoCode rules related to eco-design, you will have to:
Extend
and create the new Quality ProfileActivate more
to add new rules to the Quality Profileeco-design
or ecocode
. You should have now displayed all rules integrated with Ecocode SonarQube plugin. To add them in your profile, click on Bulk Change
and select Active in
your quality profile.Quality Profile
page and set up the extended quality Profile as default one. SonarQube will now use this Quality Profile with ecodesign rules to audit your code.Do the same setup for each language you wish to use with Ecocode rules.
EcoIndex makes it possible to become aware of the environmental impact of the Internet and to propose concrete solutions. You enter a URL into the EcoIndex, which then calculates the performance and environmental footprint of the tested page represented by a score out of 100 and a rating from A to G (the higher the rating, the better!). Several criteria are taken into account by our calculation method:
Official website: https://www.ecoindex.fr/
Chrome extension: https://chrome.google.com/webstore/detail/greenit-analysis/mofbfhffeklkbebfclfaiifefjflcpad?hl=fr
GitHub Link: https://github.com/cnumr/GreenIT-Analysis-cli
Lighthouse is an open-source, automated tool for improving the quality of web pages. You can run it against any web page, public or requiring authentication. It has audits for performance, accessibility and more. By default, Lighthouse produces a report in JSON or HTML. We will store the JSON report provided in the database to be able to monitor the various performances afterwards. It is also possible to customize this report to obtain only the desired metrics.
Official website: https://developer.chrome.com/docs/lighthouse/overview/
Chrome extension: https://chrome.google.com/webstore/detail/lighthouse/blipmdconlkpinefehnmjammfjpmpbjk
GitHub Link: https://github.com/GoogleChrome/lighthouse
The Markup Validator is a free service by W3C that helps check the validity of Web documents. Validating Web documents is an important step which can dramatically help improving and ensuring their quality, and it can save a lot of time and money. Validating Web Pages is also an important accessibility best practices to resolve (RGAA, criteria 8.2). If the HTML code is not well formatted, the browser will dynamically correct a certain number of elements to best display the pages causing problems. These dynamic corrections consume resources unnecessarily each time the pages concerned are loaded.
Official website: https://validator.w3.org/
GitHub Link: https://github.com/zrrrzzt/html-validator
EcoCode is a SonarQube plugin developed by a french open-source community called Green Code Initiative. Their goal is to share best practices of development, be aware of environmental responsibility when programming, and together construct rules and metrics for assigning to mobile and web applications an "environmental label". They have defined a list of green coding rules to be checked through a Sonarqube analysis to reduce RAM or CPU usage of software application.
Official website: https://www.ecocode.io/
GitHub Link: https://github.com/green-code-initiative
To get more info on EcoSonar, you can contact ecosonar-team@accenture.com and have a look at our new website : https://ecosonar.org.
EcoSonar has been conceived with respect of the licensing rights of the following repository :
GreenIT-Analysis licence : https://github.com/cnumr/GreenIT-Analysis-cli/blob/master/LICENSE
EcoIndex licence : https://creativecommons.org/licenses/by-nc-nd/2.0/fr/
Google Lighthouse licence : https://github.com/GoogleChrome/lighthouse/blob/main/LICENSE
W3C Validator licence : https://github.com/zrrrzzt/html-validator/blob/HEAD/LICENSE
EcoCode licence : https://github.com/green-code-initiative/ecoCode/blob/main/LICENCE.md
To know more on ecodesign best practices, EcoIndex Calculator and how an ecodesign website can be more efficient, please check these two articles from one of our colleagues: