SonarQube plugins
Creedengo’s first implementation is as SonarQube plugins, which can be used to detect code smells through SonarQube’s static analysis of your code.
SonarQube plugins for ecodesign
Creedengo provides two kinds of plugins:
-
Plugins for web/back-office (Java, JavaScript, PHP, Python). They use code smells described in the 2nd edition of the repository, published in September 2015. You can find all the rules here (in French). The repository for web/back-office rules is green-code-initiative/creedengo-rules-specifications.
-
Plugins for mobile (Android/iOS), using a set of code smells theorised by Dr. Olivier Le Goaër. You can find this plugin in the repository green-code-initiative/ecoCode-android.
How a SonarQube plugin works
Code is parsed to be transformed as an Abstract Syntax Tree (AST).
The AST allows the scanner to access one or more nodes in the analyzed code.
For example, it is then possible to access all for loops, to explore content etc.
The plugin defines rules and checks whether the parsed AST is compliant.
When it is not, an issue is raised and made available in SonarQube’s UI.
To better understand AST structure, you can use the AST Explorer.
Supported languages
Creedengo supports 7 technologies right now:
-
"Standard" plugins:
-
JavaScript plugin (⚠️ integration in documentation pending)
-
PHP plugin (⚠️ integration in documentation pending)
-
Python plugin (⚠️ integration in documentation pending)
-
C# plugin (⚠️ integration in documentation pending)
-
Mobile plugins:
-
Android plugin (⚠️ integration in documentation pending)
-
iOS plugin (⚠️ integration in documentation pending)
-
🛒 Distribution
The primary way to obtain Creedengo plugins is through the SonarQube Marketplace, accessible in the Administration section. Alternatively, you can download them directly from the GitHub releases.
| The (then-"ecoCode") plugins were previously hosted on a single repository. We split it to one repository per plugin in December 2023. Thus, the plugin should be retrieved from a repository or another depending on the wanted version. |
-
Java plugin:
-
from 0.x to 1.4.3: creedengo repository
-
since 1.5.0: creedengo-java repository
-
-
PHP plugin:
-
from 0.x to 1.3.1: creedengo repository
-
since 1.4.0: creedengo-php repository
-
-
Python plugin:
-
from 0.x to 1.3.1: creedengo repository
-
since 1.4.0: creedengo-python repository
-
-
Javascript plugin:
-
from 0.x to 1.3.0: creedengo repository
-
since 1.4.0: creedengo-javascript repository
-
-
C# plugin: creedengo-csharp repository
-
Android plugin: creedengo-android repository
-
iOS plugin: creedengo-ios repository