0

If I call

ruleFinder.findAll(RuleQuery.create().withRepositoryKey("squid"));

Only 10 results are called, despite the fact that the active profile has considerably more than this enabled from the squid repository.

Presumably this is an intentional (but undocumented) limit on the number of returned results.

Can this be worked around or is there another way for a server side component to get access to the active rules? The ActiveRules interface looks to be batch side only.

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
henry
  • 5,923
  • 29
  • 46

2 Answers2

0

There is no limit on the number of returned results. I also had the problem that the rulefinder didn't find all the rules with the specific repository key. However i was able to find the rule with the specific rule key, but that's not really a solution, you would have to find all rules seperatly.

Almira
  • 31
  • 3
  • So findAll is basically just broken? – henry Apr 29 '16 at 11:50
  • Actually rulefinder is deprecated : http://javadocs.sonarsource.org/5.4/apidocs/org/sonar/api/rules/RuleFinder.html#findByKey(org.sonar.api.rule.RuleKey) – Almira Apr 29 '16 at 11:52
  • Apparently only deprecated for batch use. No replacement for serverside. – henry Apr 29 '16 at 11:53
  • You are right, i haven't found a solution or that there is a bug, the only solution i had is that i would find a specific rule but like i said that wasnt really an option so i added the rules manaully. – Almira Apr 29 '16 at 11:56
0

Unfortunately this is a bug. It will be fixed in version 5.6 : https://jira.sonarsource.com/browse/SONAR-6390.

Simon Brandhof
  • 5,137
  • 1
  • 21
  • 28