diff --git a/conf/release.Dockerfile b/conf/release.Dockerfile index e16fcb8c..21686738 100644 --- a/conf/release.Dockerfile +++ b/conf/release.Dockerfile @@ -28,7 +28,7 @@ COPY ./LICENSE . COPY ./sonar/audit sonar/audit RUN pip install --upgrade pip \ -&& pip install sonar-tools==3.17 +&& pip install sonar-tools==3.16.2 USER ${USERNAME} WORKDIR /home/${USERNAME} diff --git a/doc/what-is-new.md b/doc/what-is-new.md index fd68dc39..500b67b5 100644 --- a/doc/what-is-new.md +++ b/doc/what-is-new.md @@ -1,6 +1,6 @@ # Next version -# Version 3.16.1 +# Version 3.16.2 - Patch for [Issue #2039](https://github.com/okorach/sonar-tools/issues/2039) that may affect merely all the Sonar Tools diff --git a/pyproject.toml b/pyproject.toml index 839b14d8..fa9079ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "sonar-tools" -version = "3.17" +version = "3.16.2" description = "A collection of utility tools for the SonarQube ecosystem" authors = [ {name = "Olivier Korach", email = "olivier.korach@gmail.com"}, diff --git a/sonar/util/project_utils.py b/sonar/util/project_utils.py index 03cdc8e8..34abcda2 100644 --- a/sonar/util/project_utils.py +++ b/sonar/util/project_utils.py @@ -17,9 +17,11 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -"""Project utility functions""" + +""" Project utility functions """ import math +from sonar import logging as log def split_loc_filter(loc_filter: str) -> tuple[str, str]: @@ -50,7 +52,8 @@ def split_loc_filter(loc_filter: str) -> tuple[str, str]: pass else: new_filters.append(f) - loc_middle = int(math.exp((math.log2(loc_max) - math.log2(max(loc_min, 1))) / 2)) + loc_middle = int(2 ** ((math.log2(loc_max) + math.log2(max(loc_min, 1))) / 2)) + log.debug("LoC split: min=%d, middle=%d, max=%d", loc_min, loc_middle, loc_max) slice1 = __FILTER_AND.join(new_filters + [f"ncloc>={loc_min}", f"ncloc<={loc_middle}"]) slice2 = __FILTER_AND.join(new_filters + [f"ncloc>{loc_middle}", f"ncloc<={loc_max}"]) return slice1, slice2