Skip to content

Commit c8adc75

Browse files
authored
Fix-bug (#1988)
* Fix bug never encoutered yet * Fix bug
1 parent 8390d6b commit c8adc75

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sonar/languages.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import sonar.platform as pf
3030
from sonar.util.types import ApiPayload
3131
from sonar.util import cache
32+
from sonar.util import constants as c
3233

3334
#: List of language APIs
3435
APIS = {"list": "languages/list"}
@@ -75,10 +76,10 @@ def number_of_rules(self, rule_type: str = None) -> int:
7576
:returns: Nbr of rules for that language (and optional type)
7677
:rtype: int
7778
"""
78-
if not rule_type or rule_type not in rules.LEGACY_TYPES:
79+
if not rule_type or rule_type not in (c.VULN, c.HOTSPOT, c.BUG, c.CODE_SMELL):
7980
rule_type = "_ALL"
8081
if not self._nb_rules[rule_type]:
81-
self._nb_rules[rule_type] = rules.search(self.endpoint, languages=self.key, types=rule_type)
82+
self._nb_rules[rule_type] = rules.search(self.endpoint, params={"languages": self.key, "types": rule_type})
8283
return self._nb_rules[rule_type]
8384

8485

0 commit comments

Comments
 (0)