wttech / AEM-Rules-for-SonarQube

SonarQube plugin with set of rules detecting possible bugs and bad smells specific for AEM development.
Apache License 2.0
112 stars 51 forks source link

New Rule: "Do not use SlingSettingsService.getRunModes()" #193

Open joerghoh opened 4 years ago

joerghoh commented 4 years ago

I want to propose a new rule, which reports any usage of API call SlingSettingsService.getRunModes().

In AEM projects, every dependency to a specific environment must be solved by creating a runmode-aware OSGI configuration, which will be picked up correctly, and without any need to specify this in the application code.

That means, that any usage of the above mentioned call is not necessary and should be considered as Design Smell.