Current API ProfileDefinition is not easy to use on SonarQube side.
To load the list of profiles defined by plugins we need to call ProfileDefinition.createProfile(ValidationMessages validation), that will return an RulesProfile object (Hibernate model API).
Here are some things to improve :
- Each times the profile definitions are loaded, rules of profiles are loaded from db (they should only be loaded if needed when defining the profile, not when loading it)
- There's no way to know the language of the profile (we have to call createProfile(), and each time all rules are loaded even for profile that we do not need).
We should create a new API in the same way of RulesDefinition.