SonarQube plugins
ecoCode is distributed as a set of plugins for SonarQube.
Plugins for eco-design
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.
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.
Learn more at https://docs.sonarqube.org/latest/analysis/overview/