aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java10
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/technicaldebt/DebtDecorator.java (renamed from plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/technicaldebt/TechnicalDebtDecorator.java)4
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/technicaldebt/NewDebtDecorator.java (renamed from plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/technicaldebt/NewTechnicalDebtDecorator.java)7
-rw-r--r--plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/technicaldebt/DebtDecoratorTest.java (renamed from plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/technicaldebt/TechnicalDebtDecoratorTest.java)8
-rw-r--r--plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/technicaldebt/NewDebtDecoratorTest.java (renamed from plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/technicaldebt/NewTechnicalDebtDecoratorTest.java)6
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/debt/IssueChangelogDebtCalculator.java3
6 files changed, 21 insertions, 17 deletions
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
index 3bc062fa253..3b4d49268d3 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java
@@ -41,8 +41,8 @@ import org.sonar.plugins.core.measurefilters.ProjectFilter;
import org.sonar.plugins.core.notifications.alerts.NewAlerts;
import org.sonar.plugins.core.security.ApplyProjectRolesDecorator;
import org.sonar.plugins.core.sensors.*;
-import org.sonar.plugins.core.technicaldebt.NewTechnicalDebtDecorator;
-import org.sonar.plugins.core.technicaldebt.TechnicalDebtDecorator;
+import org.sonar.plugins.core.technicaldebt.DebtDecorator;
+import org.sonar.plugins.core.technicaldebt.NewDebtDecorator;
import org.sonar.plugins.core.timemachine.*;
import org.sonar.plugins.core.web.TestsViewer;
import org.sonar.plugins.core.widgets.*;
@@ -291,8 +291,8 @@ public final class CorePlugin extends SonarPlugin {
NewFalsePositiveNotificationDispatcher.newMetadata(),
// technical debt
- TechnicalDebtDecorator.class,
- NewTechnicalDebtDecorator.class,
+ DebtDecorator.class,
+ NewDebtDecorator.class,
IssueChangelogDebtCalculator.class,
// batch
@@ -337,7 +337,7 @@ public final class CorePlugin extends SonarPlugin {
extensions.addAll(IssueExclusionsConfiguration.getPropertyDefinitions());
extensions.addAll(CoverageMeasurementFilter.getPropertyDefinitions());
extensions.addAll(PastSnapshotFinder.getPropertyDefinitions());
- extensions.addAll(TechnicalDebtDecorator.definitions());
+ extensions.addAll(DebtDecorator.definitions());
extensions.addAll(propertyDefinitions());
return extensions.build();
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/technicaldebt/TechnicalDebtDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/technicaldebt/DebtDecorator.java
index c17c7021098..e146e03a9df 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/technicaldebt/TechnicalDebtDecorator.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/technicaldebt/DebtDecorator.java
@@ -56,7 +56,7 @@ import static com.google.common.collect.Maps.newHashMap;
* Decorator that computes the technical debt metric
*/
@DependsUpon(DecoratorBarriers.ISSUES_TRACKED)
-public final class TechnicalDebtDecorator implements Decorator {
+public final class DebtDecorator implements Decorator {
private final ResourcePerspectives perspectives;
private final TechnicalDebtModel model;
@@ -67,7 +67,7 @@ public final class TechnicalDebtDecorator implements Decorator {
*/
private final RuleFinder ruleFinder;
- public TechnicalDebtDecorator(ResourcePerspectives perspectives, TechnicalDebtModel model, Rules rules, RuleFinder ruleFinder) {
+ public DebtDecorator(ResourcePerspectives perspectives, TechnicalDebtModel model, Rules rules, RuleFinder ruleFinder) {
this.perspectives = perspectives;
this.model = model;
this.rules = rules;
diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/technicaldebt/NewTechnicalDebtDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/technicaldebt/NewDebtDecorator.java
index 6239e0b21ba..f5f7062a584 100644
--- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/technicaldebt/NewTechnicalDebtDecorator.java
+++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/technicaldebt/NewDebtDecorator.java
@@ -36,6 +36,7 @@ import org.sonar.batch.components.TimeMachineConfiguration;
import org.sonar.batch.debt.IssueChangelogDebtCalculator;
import javax.annotation.Nullable;
+
import java.util.Collection;
import java.util.Date;
import java.util.List;
@@ -46,14 +47,14 @@ import static com.google.common.collect.Lists.newArrayList;
* Decorator that computes the technical debt metric
*/
@DependsUpon(DecoratorBarriers.ISSUES_TRACKED)
-public final class NewTechnicalDebtDecorator implements Decorator {
+public final class NewDebtDecorator implements Decorator {
private final ResourcePerspectives perspectives;
private final TimeMachineConfiguration timeMachineConfiguration;
private final IssueChangelogDebtCalculator issueChangelogDebtCalculator;
- public NewTechnicalDebtDecorator(ResourcePerspectives perspectives, TimeMachineConfiguration timeMachineConfiguration,
- IssueChangelogDebtCalculator issueChangelogDebtCalculator) {
+ public NewDebtDecorator(ResourcePerspectives perspectives, TimeMachineConfiguration timeMachineConfiguration,
+ IssueChangelogDebtCalculator issueChangelogDebtCalculator) {
this.perspectives = perspectives;
this.timeMachineConfiguration = timeMachineConfiguration;
this.issueChangelogDebtCalculator = issueChangelogDebtCalculator;
diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/technicaldebt/TechnicalDebtDecoratorTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/technicaldebt/DebtDecoratorTest.java
index 958c1eb522d..457b72ad0d7 100644
--- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/technicaldebt/TechnicalDebtDecoratorTest.java
+++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/technicaldebt/DebtDecoratorTest.java
@@ -58,7 +58,7 @@ import static org.mockito.Matchers.any;
import static org.mockito.Mockito.*;
@RunWith(MockitoJUnitRunner.class)
-public class TechnicalDebtDecoratorTest {
+public class DebtDecoratorTest {
static final int HOURS_IN_DAY = 8;
@@ -92,7 +92,7 @@ public class TechnicalDebtDecoratorTest {
DefaultCharacteristic reusability = new DefaultCharacteristic().setKey("REUSABILITY");
DefaultCharacteristic modularity = new DefaultCharacteristic().setKey("MODULARITY").setParent(reusability);
- TechnicalDebtDecorator decorator;
+ DebtDecorator decorator;
@Before
public void before() throws Exception {
@@ -111,7 +111,7 @@ public class TechnicalDebtDecoratorTest {
when(debtModel.characteristicByKey("REUSABILITY")).thenReturn(reusability);
when(debtModel.characteristicByKey("MODULARITY")).thenReturn(modularity);
- decorator = new TechnicalDebtDecorator(perspectives, debtModel, rules, ruleFinder);
+ decorator = new DebtDecorator(perspectives, debtModel, rules, ruleFinder);
}
@Test
@@ -281,7 +281,7 @@ public class TechnicalDebtDecoratorTest {
@Test
public void check_definitions() {
- assertThat(TechnicalDebtDecorator.definitions()).hasSize(1);
+ assertThat(DebtDecorator.definitions()).hasSize(1);
}
private DefaultIssue createIssue(String ruleKey, String repositoryKey) {
diff --git a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/technicaldebt/NewTechnicalDebtDecoratorTest.java b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/technicaldebt/NewDebtDecoratorTest.java
index 9753e2d0c99..a9391f96da2 100644
--- a/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/technicaldebt/NewTechnicalDebtDecoratorTest.java
+++ b/plugins/sonar-core-plugin/src/test/java/org/sonar/plugins/core/technicaldebt/NewDebtDecoratorTest.java
@@ -54,9 +54,9 @@ import static org.mockito.Matchers.argThat;
import static org.mockito.Mockito.*;
@RunWith(MockitoJUnitRunner.class)
-public class NewTechnicalDebtDecoratorTest {
+public class NewDebtDecoratorTest {
- NewTechnicalDebtDecorator decorator;
+ NewDebtDecorator decorator;
@Mock
TimeMachineConfiguration timeMachineConfiguration;
@@ -100,7 +100,7 @@ public class NewTechnicalDebtDecoratorTest {
when(timeMachineConfiguration.periods()).thenReturn(newArrayList(new Period(1, fiveDaysAgo), new Period(2, tenDaysAgo)));
- decorator = new NewTechnicalDebtDecorator(perspectives, timeMachineConfiguration, new IssueChangelogDebtCalculator());
+ decorator = new NewDebtDecorator(perspectives, timeMachineConfiguration, new IssueChangelogDebtCalculator());
}
@Test
diff --git a/sonar-batch/src/main/java/org/sonar/batch/debt/IssueChangelogDebtCalculator.java b/sonar-batch/src/main/java/org/sonar/batch/debt/IssueChangelogDebtCalculator.java
index 87a2c26b5d0..d34d0004500 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/debt/IssueChangelogDebtCalculator.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/debt/IssueChangelogDebtCalculator.java
@@ -36,6 +36,9 @@ import java.util.*;
import static com.google.common.collect.Lists.newArrayList;
+/**
+ * Warning, before modifying this class, please do not forget that it's used by the Dev Cockpit plugin
+ */
public class IssueChangelogDebtCalculator implements BatchComponent {
@CheckForNull