@Override
public List<Rule> createRules() {
List<Rule> rules = new ArrayList<>();
PluginConfigurationReader pluginConfigurationReader = new PluginConfigurationReaderImpl();
RulePluginRepository rulePluginRepository;
try {
rulePluginRepository = new RulePluginRepositoryImpl(pluginConfigurationReader);
} catch (PluginRepositoryException e) {
throw new SonarException("Cannot read rules.", e);
}
List<Source> ruleSources = rulePluginRepository.getRuleSources();
RuleSetReader ruleSetReader = new RuleSetReaderImpl();
RuleSet ruleSet = ruleSetReader.read(ruleSources);
for (Concept concept : ruleSet.getConcepts().values()) {
rules.add(createRule(concept, RuleType.Concept));
}