aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-server-common/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2018-07-30 10:31:26 +0200
committerSonarTech <sonartech@sonarsource.com>2018-08-02 20:21:35 +0200
commit479692131cc5a51c7bddc329b2b2c3e80bd30fd0 (patch)
treeeee1b6fad7134b0e718e9058aa1d796b313059ff /server/sonar-server-common/src
parent92fb3dc68dff7aa937f005bbda644a2dc27f62d6 (diff)
downloadsonarqube-479692131cc5a51c7bddc329b2b2c3e80bd30fd0.tar.gz
sonarqube-479692131cc5a51c7bddc329b2b2c3e80bd30fd0.zip
SONAR-11077 remove dead code from MetricStatsInt
Diffstat (limited to 'server/sonar-server-common/src')
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/DistributedMetricStatsInt.java4
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/MetricStatsInt.java4
-rw-r--r--server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/NewIssuesStatistics.java8
-rw-r--r--server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesStatisticsTest.java5
4 files changed, 0 insertions, 21 deletions
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/DistributedMetricStatsInt.java b/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/DistributedMetricStatsInt.java
index 5502fabe524..dfd1a3847af 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/DistributedMetricStatsInt.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/DistributedMetricStatsInt.java
@@ -46,10 +46,6 @@ public class DistributedMetricStatsInt {
return globalStats.getOnLeak();
}
- public int getOffLeak() {
- return globalStats.getOffLeak();
- }
-
public int getTotal() {
return globalStats.getTotal();
}
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/MetricStatsInt.java b/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/MetricStatsInt.java
index 7aa3582a367..e4a1698022b 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/MetricStatsInt.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/MetricStatsInt.java
@@ -36,10 +36,6 @@ public class MetricStatsInt {
return onLeak;
}
- public int getOffLeak() {
- return offLeak;
- }
-
public int getTotal() {
return onLeak + offLeak;
}
diff --git a/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/NewIssuesStatistics.java b/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/NewIssuesStatistics.java
index e2d8e81a29e..b26a2e2de84 100644
--- a/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/NewIssuesStatistics.java
+++ b/server/sonar-server-common/src/main/java/org/sonar/server/issue/notification/NewIssuesStatistics.java
@@ -67,10 +67,6 @@ public class NewIssuesStatistics {
return globalStatistics.hasIssuesOnLeak();
}
- public boolean hasIssuesOffLeak() {
- return globalStatistics.hasIssuesOffLeak();
- }
-
public enum Metric {
RULE_TYPE(true), TAG(true), COMPONENT(true), ASSIGNEE(true), EFFORT(false), RULE(true);
private final boolean isComputedByDistribution;
@@ -146,10 +142,6 @@ public class NewIssuesStatistics {
return getDistributedMetricStats(RULE_TYPE).getOnLeak() > 0;
}
- public boolean hasIssuesOffLeak() {
- return getDistributedMetricStats(RULE_TYPE).getOffLeak() > 0;
- }
-
@Override
public String toString() {
return "Stats{" +
diff --git a/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesStatisticsTest.java b/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesStatisticsTest.java
index b318fab55f5..2f749254a7f 100644
--- a/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesStatisticsTest.java
+++ b/server/sonar-server-common/src/test/java/org/sonar/server/issue/notification/NewIssuesStatisticsTest.java
@@ -222,7 +222,6 @@ public class NewIssuesStatisticsTest {
NewIssuesStatistics.Stats stats = underTest.getAssigneesStatistics().get(assignee);
DistributedMetricStatsInt assigneeStats = stats.getDistributedMetricStats(Metric.ASSIGNEE);
assertThat(assigneeStats.getOnLeak()).isEqualTo(1);
- assertThat(assigneeStats.getOffLeak()).isEqualTo(0);
assertThat(assigneeStats.getTotal()).isEqualTo(1);
assignees.forEach(s -> {
Optional<MetricStatsInt> forLabelOpts = assigneeStats.getForLabel(s);
@@ -230,7 +229,6 @@ public class NewIssuesStatisticsTest {
assertThat(forLabelOpts.isPresent()).isTrue();
MetricStatsInt forLabel = forLabelOpts.get();
assertThat(forLabel.getOnLeak()).isEqualTo(1);
- assertThat(forLabel.getOffLeak()).isEqualTo(0);
assertThat(forLabel.getTotal()).isEqualTo(1);
} else {
assertThat(forLabelOpts.isPresent()).isFalse();
@@ -252,7 +250,6 @@ public class NewIssuesStatisticsTest {
NewIssuesStatistics.Stats stats = underTest.getAssigneesStatistics().get(assignee);
DistributedMetricStatsInt assigneeStats = stats.getDistributedMetricStats(Metric.ASSIGNEE);
assertThat(assigneeStats.getOnLeak()).isEqualTo(0);
- assertThat(assigneeStats.getOffLeak()).isEqualTo(1);
assertThat(assigneeStats.getTotal()).isEqualTo(1);
assignees.forEach(s -> {
Optional<MetricStatsInt> forLabelOpts = assigneeStats.getForLabel(s);
@@ -260,7 +257,6 @@ public class NewIssuesStatisticsTest {
assertThat(forLabelOpts.isPresent()).isTrue();
MetricStatsInt forLabel = forLabelOpts.get();
assertThat(forLabel.getOnLeak()).isEqualTo(0);
- assertThat(forLabel.getOffLeak()).isEqualTo(1);
assertThat(forLabel.getTotal()).isEqualTo(1);
} else {
assertThat(forLabelOpts.isPresent()).isFalse();
@@ -431,7 +427,6 @@ public class NewIssuesStatisticsTest {
assertThat(statsOption.isPresent()).describedAs("distribution for label %s not found", label).isTrue();
MetricStatsInt stats = statsOption.get();
assertThat(stats.getOnLeak()).isEqualTo(onLeak);
- assertThat(stats.getOffLeak()).isEqualTo(offLeak);
assertThat(stats.getTotal()).isEqualTo(total);
}