File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 2929import sonar .platform as pf
3030from sonar .util .types import ApiPayload
3131from sonar .util import cache
32+ from sonar .util import constants as c
3233
3334#: List of language APIs
3435APIS = {"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
You can’t perform that action at this time.
0 commit comments