SonarQube plugins

ecoCode is distributed as a set of plugins for SonarQube.

A screenshot of a violation detected by an ecoCode plugin in SonarQube

Plugins for eco-design

Ekko, ecoCode’s mascot, whose face depends on the code’s 'greenness'

ecoCode plugins are of two kinds:

  • Web and back-office plugins (PHP, Python, Java, JavaScript) were built using code smells described in the 2nd edition of the repository, published in September 2015. All the rules are available here (in French).

  • Mobile plugins used a set of code smells theorized by Olivier Le Goaër for Android, and later adapted for iOS.

List of all ecoCode plugins

How a SonarQube plugin works

Code is parsed to be transformed as an abstract syntax tree (AST for short). The AST will allow you to access one or more nodes of your code. For example, you’ll be able to access all of your for loop, to explore content, etc.

To better understand the AST structure, you can use the AST Explorer.