Skip to content

Commit 4186d53

Browse files
committed
use math.ceil()
1 parent 005e490 commit 4186d53

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sonar/issues.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
from __future__ import annotations
2222

23+
import math
2324
from datetime import date, datetime, timedelta
2425
import json
2526
import re
@@ -830,7 +831,7 @@ def count_by_rule(endpoint: pf.Platform, **kwargs) -> dict[str, int]:
830831
SLICE_SIZE = 50 # Search rules facets by bulks of 50
831832
if "rules" in kwargs:
832833
ruleset = kwargs.pop("rules")
833-
nbr_slices = (len(ruleset) + SLICE_SIZE - 1) // SLICE_SIZE
834+
nbr_slices = math.ceil(len(ruleset) / SLICE_SIZE)
834835
params = pre_search_filters(endpoint=endpoint, params=kwargs)
835836
params.update({"ps": 1, "facets": "rules"})
836837
rulecount = {}

0 commit comments

Comments
 (0)