ecosonar

EcoSonar, the ecodesign audit tool

https://github.com/accenture/ecosonar

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.6%) to scientific vocabulary

Keywords

accessibility-testing best-practices ecodesign ecoindex greenit lighthouse monitoring rgaa rgesn sonarqube sonarqube-plugin

Keywords from Contributors

projection interactive serializer measurement cycles packaging charts network-simulation archival shellcodes
Last synced: 6 months ago · JSON representation

Repository

EcoSonar, the ecodesign audit tool

Basic Info
  • Host: GitHub
  • Owner: Accenture
  • License: agpl-3.0
  • Language: JavaScript
  • Default Branch: main
  • Homepage: https://ecosonar.org/
  • Size: 33.5 MB
Statistics
  • Stars: 58
  • Watchers: 10
  • Forks: 20
  • Open Issues: 17
  • Releases: 6
Topics
accessibility-testing best-practices ecodesign ecoindex greenit lighthouse monitoring rgaa rgesn sonarqube sonarqube-plugin
Created almost 4 years ago · Last pushed 8 months ago
Metadata Files
Readme Changelog Contributing License

README.md

Logo

EcoSonar, the eco-design audit tool

User guide: https://github.com/Accenture/EcoSonar/blob/main/USER_GUIDE.md

Main objectives of EcoSonar:

  • Raising the awareness of delivery teams to environmental issues: enabling development teams to consider the environmental impact of digital technology during development and to promote knowledge of best eco-design and accessibility practices.
  • Helping developers to implement best eco-design and accessibility practices with:
    • Static Code Analysis with SonarQube, and dedicated green coding rules with the addition of Plugin EcoCode (https://www.ecocode.io/)
    • Dynamic Code Analysis with EcoSonar API using three open-source tools to analyze the application as it is rendered on a web browser (Green-IT Analysis/EcoIndex, Google Lighthouse and W3C Validator).
  • Get an environmental & performance monitoring solution to allow continuous improvement of delivery teams.

Summary

EcoSonar Architecture

The EcoSonar tool consists of:

  • A containerized Node.js API

    • run a GreenIT-Analysis/EcoIndex, Google Lighthouse and W3C Validator analysis for a project containing a list of predefined URLs.
    • store audits in MongoDB Database
    • retrieve audits through API calls.
  • Sonarqube plugins

    • Able to configure and retrieve EcoSonar audit reports on dynamic rendering analysis.
    • Launch an EcoSonar analysis by calling the API when a Sonarqube analysis is triggered.
    • Add new eco-design coding rules in Sonarqube default configuration with EcoCode plugins.

Architecture

Example of Architecture deployed on Azure:

Ecosonar Architecture Azure

Infrastructure Requirements

  • Docker Registry: storage of the Ecosonar API Docker image. You can directly use our Github Package which host a Docker image of EcoSonar
  • Docker server with RAM > 4Gb necessary for the analysis by Google Lighthouse
  • MongoDB database
  • Private network: protects the data stored in the database and makes it only accessible to the specified services.
  • Subnet associated with the private network: connection between the database and the API
  • Password Manager: store the password to access the database from the API

EcoSonar Local Installation

To install EcoSonar locally, you have two options:

  1. Use Docker Compose

Run the following commands: ``` cd EcoSonar-SonarQube export REACTAPPBASEURLECOSONAR_API=http://localhost:3000 mvn clean package -Durl=http://localhost:3000

cd .. docker-compose build docker-compose up ```

  1. Launch each component separately. Follow instructions in both Readme file:
  2. https://github.com/Accenture/EcoSonar/blob/main/EcoSonar-API/README.md
  3. https://github.com/Accenture/EcoSonar/blob/main/EcoSonar-SonarQube/README.md

Ecocode Configuration

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:

  • create a new Quality Profile based on the default one : click on the Setting icon for the languge you wish to extend and then Click on Extend and create the new Quality Profile

EcoSonar Quality Profile Creation

  • Click on Activate more to add new rules to the Quality Profile

EcoSonar Quality Profile Set up

  • In the list of rules, filter using the tag eco-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.

EcoSonar Quality Profile Activate Rules

  • Go back in the 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.

EcoSonar Default Quality Profile

Do the same setup for each language you wish to use with Ecocode rules.

Audit Tools

GreenIT-Analysis/EcoIndex

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:

  • The complexity of the page: the DOM (Document Object Model) represents the structure and the elements of an HTML web page. The more elements the DOM contains, the more complex the page is to decipher, and therefore to display for the browser. Concretely, all this means a greater effort to provide on the part of the processor of your computer to display the page, which reduces the life of your equipment.
  • The weight of data transferred: before appearing on your screen, a web page is a set of data stored on a server. When you access a page, your browser sends a request to the server to communicate this data to it, in order to format it and display it on your screen. Only here: the transport of this data, more or less heavy, from the server to the browser requires energy.
  • The number of HTTP requests: this criterion makes it possible to take into account the effort made by the servers to display the tested page. The greater the number of requests for the same page, the more servers will be needed to serve this page.

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

Google Lighthouse

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

W3C Validator

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

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

About

To get more info on EcoSonar, you can contact ecosonar-team@accenture.com.

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:

https://blog.octo.com/sous-le-capot-de-la-mesure-ecoindex/

https://blog.octo.com/une-bonne-pratique-vers-un-numerique-plus-responsable-mesurer-le-ressenti-des-internautes/

Owner

  • Name: Accenture
  • Login: Accenture
  • Kind: organization

Accenture Github site

GitHub Events

Total
  • Issues event: 6
  • Watch event: 6
  • Member event: 1
  • Push event: 2
  • Pull request review event: 1
  • Pull request event: 2
  • Fork event: 1
Last Year
  • Issues event: 6
  • Watch event: 6
  • Member event: 1
  • Push event: 2
  • Pull request review event: 1
  • Pull request event: 2
  • Fork event: 1

Committers

Last synced: 6 months ago

All Time
  • Total Commits: 101
  • Total Committers: 13
  • Avg Commits per committer: 7.769
  • Development Distribution Score (DDS): 0.317
Past Year
  • Commits: 11
  • Committers: 4
  • Avg Commits per committer: 2.75
  • Development Distribution Score (DDS): 0.636
Top Committers
Name Email Commits
Haupais a****s@a****m 69
Ashvin Appigadoo a****o@a****m 8
ashvinappi 3****i 7
Augustin_dltt a****e@g****m 5
Loïc Kaczmarek l****k@o****m 3
sboudaya 1****a 2
dependabot[bot] 4****] 1
Melanie LE ROY 1****v 1
Maikel Dolle m****l@i****l 1
ashvinApp24 a****i@g****m 1
augustin.de_la_taille a****e@a****m 1
David DE CARVALHO d****o@s****m 1
Boudaya s****a@a****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 19
  • Total pull requests: 23
  • Average time to close issues: 5 months
  • Average time to close pull requests: 4 days
  • Total issue authors: 10
  • Total pull request authors: 14
  • Average comments per issue: 0.95
  • Average comments per pull request: 0.09
  • Merged pull requests: 15
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 6
  • Pull requests: 4
  • Average time to close issues: N/A
  • Average time to close pull requests: 2 days
  • Issue authors: 4
  • Pull request authors: 3
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • alicehaupais (5)
  • dedece35 (3)
  • rrousset-michelin (2)
  • itmagix (2)
  • AlexTraveylan (2)
  • ewanklomp (1)
  • guillaumedif (1)
  • AdriTheSky (1)
  • itwars (1)
  • bordage (1)
Pull Request Authors
  • loickaczmarek (5)
  • alicehaupais (5)
  • ashvinappi (3)
  • dependabot[bot] (3)
  • AdriTheSky (2)
  • ashvinApp24 (2)
  • GloupGloup (2)
  • itmagix (2)
  • rajnayan-91 (2)
  • dedece35 (1)
  • carmel2509 (1)
  • Adlt92 (1)
  • mlr-acc-dev (1)
  • jay-79 (1)
Top Labels
Issue Labels
bug (2) enhancement (2)
Pull Request Labels
dependencies (3)

Dependencies

EcoSonar-SonarQube/pom.xml maven
  • org.sonarsource.java:sonar-java-plugin 7.4.0.27839 provided
  • org.sonarsource.sonarqube:sonar-plugin-api 8.0 provided
  • org.apache.commons:commons-lang3 3.12.0
  • org.sonarsource.analyzer-commons:sonar-analyzer-commons 1.19.0.786
EcoSonar-API/package.json npm
  • eslint ^8.20.0 development
  • eslint-config-standard ^17.0.0 development
  • eslint-plugin-import ^2.26.0 development
  • eslint-plugin-node ^11.1.0 development
  • eslint-plugin-promise ^6.0.0 development
  • nodemon ^2.0.19 development
  • @azure/identity ^2.1.0
  • @azure/keyvault-secrets ^4.4.0
  • concat-files ^0.1.1
  • cors ^2.8.5
  • dotenv ^16.0.1
  • express ^4.18.1
  • glob ^8.0.3
  • js-yaml ^4.1.0
  • lighthouse ^9.6.3
  • mongodb ^4.8.0
  • mongoose ^6.4.6
  • puppeteer ^15.5.0
  • puppeteer-har ^1.1.2
  • uniqid ^5.4.0
EcoSonar-SonarQube/package.json npm
  • @babel/core ^7.17.2 development
  • @babel/eslint-parser ^7.17.0 development
  • @babel/plugin-transform-runtime ^7.17.0 development
  • @babel/preset-env ^7.16.11 development
  • @babel/preset-react ^7.16.7 development
  • babel-eslint ^10.1.0 development
  • babel-loader ^8.2.3 development
  • babel-preset-es2015 ^6.24.1 development
  • babel-preset-react ^6.24.1 development
  • css-loader ^6.4.0 development
  • detect-port 1.3.0 development
  • dotenv 10.0.0 development
  • eslint ^7.32.0 development
  • eslint-config-standard ^16.0.3 development
  • eslint-plugin-import ^2.25.2 development
  • eslint-plugin-node ^11.1.0 development
  • eslint-plugin-promise ^5.1.1 development
  • eslint-plugin-react ^7.26.1 development
  • interweave ^12.9.0 development
  • jest 27.2.5 development
  • postcss-loader ^6.2.0 development
  • react 17.0.2 development
  • react-dev-utils 0.2.1 development
  • react-dom 17.0.2 development
  • sass ^1.49.7 development
  • sass-loader ^10.2.1 development
  • standard ^16.0.4 development
  • style-loader ^3.3.0 development
  • uglifyjs-webpack-plugin ^2.2.0 development
  • webpack ^5.58.2 development
  • webpack-dev-server 4.3.1 development
  • apexcharts ^3.30.0
  • axios ^0.24.0
  • classnames ^2.3.1
  • file-loader ^6.2.0
  • react-apexcharts ^1.3.9
EcoSonar-API/Dockerfile docker
  • node 16-slim build
.github/workflows/publish-docker-image.yml actions
  • actions/checkout v4 composite
  • docker/build-push-action f2a1d5e99d037542a71f64918e516c093c6f3fc4 composite
  • docker/login-action 65b78e6e13532edd9afa3aa52ac7964289d1a9c1 composite
  • docker/metadata-action 9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 composite
docker-compose.yml docker
  • postgres alpine
  • sonarqube lts-community