From af162bcbf3ed1fe36b03fbcb5602e0c7be186166 Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Wed, 1 Nov 2023 14:12:50 -0300 Subject: [PATCH 1/2] Code smell from sonarqube --- .../split/client/utils/FeatureFlagProcessor.java | 1 - .../split/client/testing/SplitClientForTest.java | 16 ++++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/client/src/main/java/io/split/client/utils/FeatureFlagProcessor.java b/client/src/main/java/io/split/client/utils/FeatureFlagProcessor.java index 497f37140..5f51aa815 100644 --- a/client/src/main/java/io/split/client/utils/FeatureFlagProcessor.java +++ b/client/src/main/java/io/split/client/utils/FeatureFlagProcessor.java @@ -3,7 +3,6 @@ import io.split.client.dtos.Split; import io.split.client.dtos.Status; import io.split.client.interceptors.FlagSetsFilter; -import io.split.client.interceptors.FlagSetsFilterImpl; import io.split.engine.experiments.ParsedSplit; import io.split.engine.experiments.SplitParser; import org.slf4j.Logger; diff --git a/testing/src/main/java/io/split/client/testing/SplitClientForTest.java b/testing/src/main/java/io/split/client/testing/SplitClientForTest.java index d7b8ff8ef..7fee29996 100644 --- a/testing/src/main/java/io/split/client/testing/SplitClientForTest.java +++ b/testing/src/main/java/io/split/client/testing/SplitClientForTest.java @@ -134,42 +134,42 @@ public Map getTreatmentsWithConfig(Key key, List fe @Override public Map getTreatmentsByFlagSet(String key, String flagSet, Map attributes) { - return null; + return new HashMap<>(); } @Override public Map getTreatmentsByFlagSet(Key key, String flagSet, Map attributes) { - return null; + return new HashMap<>(); } @Override public Map getTreatmentsByFlagSets(String key, List flagSets, Map attributes) { - return null; + return new HashMap<>(); } @Override public Map getTreatmentsByFlagSets(Key key, List flagSets, Map attributes) { - return null; + return new HashMap<>(); } @Override public Map getTreatmentsWithConfigByFlagSet(String key, String flagSet, Map attributes) { - return null; + return new HashMap<>(); } @Override public Map getTreatmentsWithConfigByFlagSet(Key key, String flagSet, Map attributes) { - return null; + return new HashMap<>(); } @Override public Map getTreatmentsWithConfigByFlagSets(String key, List flagSets, Map attributes) { - return null; + return new HashMap<>(); } @Override public Map getTreatmentsWithConfigByFlagSets(Key key, List flagSets, Map attributes) { - return null; + return new HashMap<>(); } @Override From b8eb7e0bcbaccd93bd15203d3d1474a0947575ad Mon Sep 17 00:00:00 2001 From: Nadia Mayor Date: Wed, 1 Nov 2023 14:24:49 -0300 Subject: [PATCH 2/2] Remove imports from EvaluatorImp --- .../main/java/io/split/engine/evaluator/EvaluatorImp.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/client/src/main/java/io/split/engine/evaluator/EvaluatorImp.java b/client/src/main/java/io/split/engine/evaluator/EvaluatorImp.java index 709b97d8c..db4da8637 100644 --- a/client/src/main/java/io/split/engine/evaluator/EvaluatorImp.java +++ b/client/src/main/java/io/split/engine/evaluator/EvaluatorImp.java @@ -1,6 +1,5 @@ package io.split.engine.evaluator; -import com.google.common.base.Stopwatch; import io.split.client.dtos.ConditionType; import io.split.client.exceptions.ChangeNumberExceptionWrapper; import io.split.engine.experiments.ParsedCondition; @@ -17,7 +16,6 @@ import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.concurrent.TimeUnit; import static com.google.common.base.Preconditions.checkNotNull; @@ -57,8 +55,7 @@ public Map evaluateFeatures(String matchi public Map evaluateFeaturesByFlagSets(String key, String bucketingKey, List flagSets, Map attributes) { List flagSetsWithNames = getFeatureFlagNamesByFlagSets(flagSets); - Map evaluations = evaluateFeatures(key, bucketingKey, flagSetsWithNames, attributes); - return evaluations; + return evaluateFeatures(key, bucketingKey, flagSetsWithNames, attributes); } private List getFeatureFlagNamesByFlagSets(List flagSets) {