]> source.dussan.org Git - sonarqube.git/commitdiff
Move CPD properties to make them back into UI
authorJulien HENRY <julien.henry@sonarsource.com>
Wed, 18 Feb 2015 08:32:25 +0000 (09:32 +0100)
committerJulien HENRY <julien.henry@sonarsource.com>
Wed, 18 Feb 2015 08:38:05 +0000 (09:38 +0100)
sonar-batch/src/main/java/org/sonar/batch/cpd/CpdComponents.java
sonar-batch/src/test/java/org/sonar/batch/cpd/CpdComponentsTest.java
sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java

index 6032e60b9b6800631ec395820e99cc09931393d4..8ab889c30d567ef5dc82ff5f93f533e17c742500 100644 (file)
 package org.sonar.batch.cpd;
 
 import com.google.common.collect.ImmutableList;
-import org.sonar.api.CoreProperties;
-import org.sonar.api.PropertyType;
-import org.sonar.api.config.PropertyDefinition;
-import org.sonar.api.resources.Qualifiers;
 import org.sonar.batch.cpd.decorators.DuplicationDensityDecorator;
 import org.sonar.batch.cpd.decorators.SumDuplicationsDecorator;
 import org.sonar.batch.cpd.index.IndexFactory;
@@ -34,38 +30,6 @@ public final class CpdComponents {
 
   public static List all() {
     return ImmutableList.of(
-      PropertyDefinition.builder(CoreProperties.CPD_CROSS_PROJECT)
-        .defaultValue(CoreProperties.CPD_CROSS_RPOJECT_DEFAULT_VALUE + "")
-        .name("Cross project duplication detection")
-        .description("By default, SonarQube detects duplications at sub-project level. This means that a block "
-          + "duplicated on two sub-projects of the same project won't be reported. Setting this parameter to \"true\" "
-          + "allows to detect duplicates across sub-projects and more generally across projects. Note that activating "
-          + "this property will slightly increase each SonarQube analysis time.")
-        .onQualifiers(Qualifiers.PROJECT, Qualifiers.MODULE)
-        .category(CoreProperties.CATEGORY_GENERAL)
-        .subCategory(CoreProperties.SUBCATEGORY_DUPLICATIONS)
-        .type(PropertyType.BOOLEAN)
-        .build(),
-      PropertyDefinition.builder(CoreProperties.CPD_SKIP_PROPERTY)
-        .defaultValue("false")
-        .name("Skip")
-        .description("Disable detection of duplications")
-        .hidden()
-        .category(CoreProperties.CATEGORY_GENERAL)
-        .subCategory(CoreProperties.SUBCATEGORY_DUPLICATIONS)
-        .type(PropertyType.BOOLEAN)
-        .build(),
-      PropertyDefinition.builder(CoreProperties.CPD_EXCLUSIONS)
-        .defaultValue("")
-        .name("Duplication Exclusions")
-        .description("Patterns used to exclude some source files from the duplication detection mechanism. " +
-          "See below to know how to use wildcards to specify this property.")
-        .onQualifiers(Qualifiers.PROJECT, Qualifiers.MODULE)
-        .category(CoreProperties.CATEGORY_EXCLUSIONS)
-        .subCategory(CoreProperties.SUBCATEGORY_DUPLICATIONS_EXCLUSIONS)
-        .multiValues(true)
-        .build(),
-
       CpdSensor.class,
       CpdMappings.class,
       SumDuplicationsDecorator.class,
index 90632426ee3860a957d8c8460ebb6c0800cac16e..1b5f9310b0a84c2cf5c6d88da7314149b206afdc 100644 (file)
@@ -27,6 +27,6 @@ public class CpdComponentsTest {
 
   @Test
   public void getExtensions() {
-    assertThat(CpdComponents.all()).hasSize(10);
+    assertThat(CpdComponents.all().size()).isGreaterThan(0);
   }
 }
index d10afcf4cf991c99a839563ed8e13d1b153c0da6..33f926a08a0a3f2568308e74b9d154b9041c06c5 100644 (file)
@@ -22,6 +22,7 @@ package org.sonar.core.config;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
 import org.sonar.api.CoreProperties;
+import org.sonar.api.PropertyType;
 import org.sonar.api.config.PropertyDefinition;
 import org.sonar.api.resources.Qualifiers;
 import org.sonar.core.computation.dbcleaner.DataCleanerProperties;
@@ -102,8 +103,41 @@ public class CorePropertyDefinitions {
         .onlyOnQualifiers(Qualifiers.PROJECT)
         .category(CoreProperties.CATEGORY_GENERAL)
         .subCategory(CoreProperties.SUBCATEGORY_DIFFERENTIAL_VIEWS)
+        .build(),
+
+      // CPD
+      PropertyDefinition.builder(CoreProperties.CPD_CROSS_PROJECT)
+        .defaultValue(CoreProperties.CPD_CROSS_RPOJECT_DEFAULT_VALUE + "")
+        .name("Cross project duplication detection")
+        .description("By default, SonarQube detects duplications at sub-project level. This means that a block "
+          + "duplicated on two sub-projects of the same project won't be reported. Setting this parameter to \"true\" "
+          + "allows to detect duplicates across sub-projects and more generally across projects. Note that activating "
+          + "this property will slightly increase each SonarQube analysis time.")
+        .onQualifiers(Qualifiers.PROJECT, Qualifiers.MODULE)
+        .category(CoreProperties.CATEGORY_GENERAL)
+        .subCategory(CoreProperties.SUBCATEGORY_DUPLICATIONS)
+        .type(PropertyType.BOOLEAN)
+        .build(),
+      PropertyDefinition.builder(CoreProperties.CPD_SKIP_PROPERTY)
+        .defaultValue("false")
+        .name("Skip")
+        .description("Disable detection of duplications")
+        .hidden()
+        .category(CoreProperties.CATEGORY_GENERAL)
+        .subCategory(CoreProperties.SUBCATEGORY_DUPLICATIONS)
+        .type(PropertyType.BOOLEAN)
+        .build(),
+      PropertyDefinition.builder(CoreProperties.CPD_EXCLUSIONS)
+        .defaultValue("")
+        .name("Duplication Exclusions")
+        .description("Patterns used to exclude some source files from the duplication detection mechanism. " +
+          "See below to know how to use wildcards to specify this property.")
+        .onQualifiers(Qualifiers.PROJECT, Qualifiers.MODULE)
+        .category(CoreProperties.CATEGORY_EXCLUSIONS)
+        .subCategory(CoreProperties.SUBCATEGORY_DUPLICATIONS_EXCLUSIONS)
+        .multiValues(true)
         .build()
-    ));
+      ));
     return defs;
   }
 }