]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8331 Rename Complexity to Cyclomatic Complexity
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Tue, 17 Oct 2017 08:46:50 +0000 (10:46 +0200)
committerTeryk Bellahsene <teryk@users.noreply.github.com>
Thu, 19 Oct 2017 10:12:11 +0000 (12:12 +0200)
sonar-core/src/main/resources/org/sonar/l10n/core.properties
sonar-core/src/test/java/org/sonar/core/i18n/DefaultI18nTest.java
sonar-plugin-api/src/main/java/org/sonar/api/measures/CoreMetrics.java

index a6f52214b65311074e543a25caed4886476225eb..970c842424655af9ae12f5a097cc767e0361542b 100644 (file)
@@ -1497,7 +1497,7 @@ metric.comment_lines_density.description=Comments balanced by ncloc + comment li
 metric.comment_lines_density.name=Comments (%)
 metric.comment_lines_density.short_name=Comments
 metric.complexity.description=Cyclomatic complexity
-metric.complexity.name=Complexity
+metric.complexity.name=Cyclomatic Complexity
 metric.complexity_in_classes.description=Cyclomatic complexity in classes
 metric.complexity_in_classes.name=Complexity in Classes
 metric.complexity_in_functions.description=Cyclomatic complexity in functions
index e310d4c97ff9e361cdabceb041c47ac868da578c..2f2ac8e820ea56490e3d94071bb099fdc04ca464 100644 (file)
@@ -26,13 +26,10 @@ import java.util.Locale;
 import java.util.TimeZone;
 import org.junit.Before;
 import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
 import org.sonar.api.measures.CoreMetrics;
 import org.sonar.api.measures.Metric;
 import org.sonar.api.utils.DateUtils;
-import org.sonar.api.utils.System2;
+import org.sonar.api.utils.internal.TestSystem2;
 import org.sonar.core.platform.PluginInfo;
 import org.sonar.core.platform.PluginRepository;
 
@@ -40,11 +37,9 @@ import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
-@RunWith(MockitoJUnitRunner.class)
 public class DefaultI18nTest {
 
-  @Mock
-  System2 system2;
+  private TestSystem2 system2 = new TestSystem2();
 
   DefaultI18n underTest;
 
@@ -189,7 +184,7 @@ public class DefaultI18nTest {
 
   @Test
   public void get_age_from_now() {
-    when(system2.now()).thenReturn(DateUtils.parseDate("2014-01-02").getTime());
+    system2.setNow(DateUtils.parseDate("2014-01-02").getTime());
     assertThat(underTest.ageFromNow(Locale.ENGLISH, DateUtils.parseDate("2014-01-01"))).isEqualTo("a day");
   }
 
index 1ff06ebfc369942e6b721c98d8ab311cec4b05e8..59ca132e6046917db33ae16cb9d71e683e138ec5 100644 (file)
@@ -355,7 +355,7 @@ public final class CoreMetrics {
   // --------------------------------------------------------------------------------------------------------------------
 
   public static final String COMPLEXITY_KEY = "complexity";
-  public static final Metric<Integer> COMPLEXITY = new Metric.Builder(COMPLEXITY_KEY, "Complexity", Metric.ValueType.INT)
+  public static final Metric<Integer> COMPLEXITY = new Metric.Builder(COMPLEXITY_KEY, "Cyclomatic Complexity", Metric.ValueType.INT)
     .setDescription("Cyclomatic complexity")
     .setDirection(Metric.DIRECTION_WORST)
     .setQualitative(false)