aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-09-18 10:17:17 +0200
committerJulien Lancelot <julien.lancelot@gmail.com>2013-09-18 10:17:17 +0200
commit62723fc7467cc38103ddee52c12bea95b5fecbed (patch)
tree9284a6d40bd9f02c03a8d6908a37a6f7f4282ba3 /plugins
parent369a9d974e4f5e48bccd76a68ade1d7497fd984a (diff)
downloadsonarqube-62723fc7467cc38103ddee52c12bea95b5fecbed.tar.gz
sonarqube-62723fc7467cc38103ddee52c12bea95b5fecbed.zip
SONAR-4660 Make Settings > 'Database Cleaner', 'Differential Views', 'Duplications', 'Localization' and 'Security' pages, some sub-categories of the 'General' page
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/CorePlugin.java239
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties5
-rw-r--r--plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java6
-rw-r--r--plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DbCleanerPlugin.java13
4 files changed, 86 insertions, 177 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 f74bc7e2b4e..d679b0e7852 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
@@ -19,104 +19,35 @@
*/
package org.sonar.plugins.core;
-import org.sonar.api.resources.Qualifiers;
-import org.sonar.api.config.PropertyDefinition;
import com.google.common.collect.ImmutableList;
-import org.sonar.api.CoreProperties;
-import org.sonar.api.Properties;
-import org.sonar.api.Property;
-import org.sonar.api.PropertyType;
-import org.sonar.api.SonarPlugin;
+import org.sonar.api.*;
import org.sonar.api.checks.NoSonarFilter;
+import org.sonar.api.config.PropertyDefinition;
import org.sonar.api.resources.Java;
+import org.sonar.api.resources.Qualifiers;
+import org.sonar.batch.components.PastSnapshotFinder;
import org.sonar.core.timemachine.Periods;
import org.sonar.plugins.core.batch.IndexProjectPostJob;
import org.sonar.plugins.core.charts.DistributionAreaChart;
import org.sonar.plugins.core.charts.DistributionBarChart;
import org.sonar.plugins.core.charts.XradarChart;
import org.sonar.plugins.core.colorizers.JavaColorizerFormat;
-import org.sonar.plugins.core.dashboards.GlobalDefaultDashboard;
-import org.sonar.plugins.core.dashboards.ProjectDefaultDashboard;
-import org.sonar.plugins.core.dashboards.ProjectHotspotDashboard;
-import org.sonar.plugins.core.dashboards.ProjectIssuesDashboard;
-import org.sonar.plugins.core.dashboards.ProjectTimeMachineDashboard;
-import org.sonar.plugins.core.issue.CountFalsePositivesDecorator;
-import org.sonar.plugins.core.issue.CountUnresolvedIssuesDecorator;
-import org.sonar.plugins.core.issue.InitialOpenIssuesSensor;
-import org.sonar.plugins.core.issue.InitialOpenIssuesStack;
-import org.sonar.plugins.core.issue.IssueHandlers;
-import org.sonar.plugins.core.issue.IssueTracking;
-import org.sonar.plugins.core.issue.IssueTrackingDecorator;
-import org.sonar.plugins.core.issue.IssuesDensityDecorator;
-import org.sonar.plugins.core.issue.WeightedIssuesDecorator;
+import org.sonar.plugins.core.dashboards.*;
+import org.sonar.plugins.core.issue.*;
import org.sonar.plugins.core.issue.ignore.IgnoreIssuesPlugin;
-import org.sonar.plugins.core.issue.notification.ChangesOnMyIssueNotificationDispatcher;
-import org.sonar.plugins.core.issue.notification.IssueChangesEmailTemplate;
-import org.sonar.plugins.core.issue.notification.NewFalsePositiveNotificationDispatcher;
-import org.sonar.plugins.core.issue.notification.NewIssuesEmailTemplate;
-import org.sonar.plugins.core.issue.notification.NewIssuesNotificationDispatcher;
-import org.sonar.plugins.core.issue.notification.SendIssueNotificationsPostJob;
+import org.sonar.plugins.core.issue.notification.*;
import org.sonar.plugins.core.measurefilters.MyFavouritesFilter;
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.BranchCoverageDecorator;
-import org.sonar.plugins.core.sensors.CheckAlertThresholds;
-import org.sonar.plugins.core.sensors.CommentDensityDecorator;
-import org.sonar.plugins.core.sensors.CoverageDecorator;
-import org.sonar.plugins.core.sensors.CoverageMeasurementFilter;
-import org.sonar.plugins.core.sensors.DirectoriesDecorator;
-import org.sonar.plugins.core.sensors.FilesDecorator;
-import org.sonar.plugins.core.sensors.GenerateAlertEvents;
-import org.sonar.plugins.core.sensors.ItBranchCoverageDecorator;
-import org.sonar.plugins.core.sensors.ItCoverageDecorator;
-import org.sonar.plugins.core.sensors.ItLineCoverageDecorator;
-import org.sonar.plugins.core.sensors.LineCoverageDecorator;
-import org.sonar.plugins.core.sensors.ManualMeasureDecorator;
-import org.sonar.plugins.core.sensors.OverallBranchCoverageDecorator;
-import org.sonar.plugins.core.sensors.OverallCoverageDecorator;
-import org.sonar.plugins.core.sensors.OverallLineCoverageDecorator;
-import org.sonar.plugins.core.sensors.ProfileEventsSensor;
-import org.sonar.plugins.core.sensors.ProfileSensor;
-import org.sonar.plugins.core.sensors.ProjectLinksSensor;
-import org.sonar.plugins.core.sensors.UnitTestDecorator;
-import org.sonar.plugins.core.sensors.VersionEventsSensor;
-import org.sonar.plugins.core.timemachine.NewCoverageAggregator;
-import org.sonar.plugins.core.timemachine.NewCoverageFileAnalyzer;
-import org.sonar.plugins.core.timemachine.NewItCoverageFileAnalyzer;
-import org.sonar.plugins.core.timemachine.NewOverallCoverageFileAnalyzer;
-import org.sonar.plugins.core.timemachine.TendencyDecorator;
-import org.sonar.plugins.core.timemachine.TimeMachineConfigurationPersister;
-import org.sonar.plugins.core.timemachine.VariationDecorator;
+import org.sonar.plugins.core.sensors.*;
+import org.sonar.plugins.core.timemachine.*;
import org.sonar.plugins.core.web.Lcom4Viewer;
import org.sonar.plugins.core.web.TestsViewer;
-import org.sonar.plugins.core.widgets.AlertsWidget;
-import org.sonar.plugins.core.widgets.ComplexityWidget;
-import org.sonar.plugins.core.widgets.CoverageWidget;
-import org.sonar.plugins.core.widgets.CustomMeasuresWidget;
-import org.sonar.plugins.core.widgets.DescriptionWidget;
-import org.sonar.plugins.core.widgets.DocumentationCommentsWidget;
-import org.sonar.plugins.core.widgets.DuplicationsWidget;
-import org.sonar.plugins.core.widgets.EventsWidget;
-import org.sonar.plugins.core.widgets.HotspotMetricWidget;
-import org.sonar.plugins.core.widgets.HotspotMostViolatedResourcesWidget;
-import org.sonar.plugins.core.widgets.HotspotMostViolatedRulesWidget;
-import org.sonar.plugins.core.widgets.ItCoverageWidget;
-import org.sonar.plugins.core.widgets.MeasureFilterListWidget;
-import org.sonar.plugins.core.widgets.MeasureFilterTreemapWidget;
-import org.sonar.plugins.core.widgets.RulesWidget;
-import org.sonar.plugins.core.widgets.SizeWidget;
-import org.sonar.plugins.core.widgets.TimeMachineWidget;
-import org.sonar.plugins.core.widgets.TimelineWidget;
-import org.sonar.plugins.core.widgets.TreemapWidget;
-import org.sonar.plugins.core.widgets.WelcomeWidget;
-import org.sonar.plugins.core.widgets.issues.ActionPlansWidget;
-import org.sonar.plugins.core.widgets.issues.FalsePositiveIssuesWidget;
-import org.sonar.plugins.core.widgets.issues.IssueFilterWidget;
-import org.sonar.plugins.core.widgets.issues.MyUnresolvedIssuesWidget;
-import org.sonar.plugins.core.widgets.issues.UnresolvedIssuesPerAssigneeWidget;
-import org.sonar.plugins.core.widgets.issues.UnresolvedIssuesStatusesWidget;
+import org.sonar.plugins.core.widgets.*;
+import org.sonar.plugins.core.widgets.issues.*;
+import java.util.Arrays;
import java.util.List;
@Properties({
@@ -184,100 +115,6 @@ import java.util.List;
global = true,
category = CoreProperties.CATEGORY_GENERAL),
@Property(
- key = CoreProperties.CORE_IMPORT_SOURCES_PROPERTY,
- defaultValue = "" + CoreProperties.CORE_IMPORT_SOURCES_DEFAULT_VALUE,
- name = "Import sources",
- description = "Set to false if sources should not be imported and therefore not available in the Web UI (e.g. for security reasons).",
- project = true,
- module = true,
- global = true,
- category = CoreProperties.CATEGORY_SECURITY,
- type = PropertyType.BOOLEAN),
- @Property(
- key = CoreProperties.CORE_FORCE_AUTHENTICATION_PROPERTY,
- defaultValue = "" + CoreProperties.CORE_FORCE_AUTHENTICATION_DEFAULT_VALUE,
- name = "Force user authentication",
- description = "Forcing user authentication stops un-logged users to access SonarQube.",
- project = false,
- global = true,
- category = CoreProperties.CATEGORY_SECURITY,
- type = PropertyType.BOOLEAN),
- @Property(
- key = CoreProperties.CORE_ALLOW_USERS_TO_SIGNUP_PROPERTY,
- defaultValue = "" + CoreProperties.CORE_ALLOW_USERS_TO_SIGNUP_DEAULT_VALUE,
- name = "Allow users to sign up online",
- description = "Users can sign up online.",
- project = false,
- global = true,
- category = CoreProperties.CATEGORY_SECURITY,
- type = PropertyType.BOOLEAN),
- @Property(
- key = CoreProperties.CORE_DEFAULT_GROUP,
- defaultValue = CoreProperties.CORE_DEFAULT_GROUP_DEFAULT_VALUE,
- name = "Default user group",
- description = "Any new users will automatically join this group.",
- project = false,
- global = true,
- category = CoreProperties.CATEGORY_SECURITY),
- @Property(
- key = CoreProperties.CORE_VIOLATION_LOCALE_PROPERTY,
- defaultValue = "en",
- name = "Locale used for violation messages",
- description = "Locale to be used when generating violation messages. It's up to each rule engine to support this global internationalization property",
- project = true,
- global = true,
- category = CoreProperties.CATEGORY_L10N),
- @Property(
- key = "sonar.timemachine.period1",
- name = "Period 1",
- description = "Period used to compare measures and track new violations. Values are : <ul class='bullet'><li>Number of days before " +
- "analysis, for example 5.</li><li>A custom date. Format is yyyy-MM-dd, for example 2010-12-25</li><li>'previous_analysis' to " +
- "compare to previous analysis</li><li>'previous_version' to compare to the previous version in the project history</li></ul>" +
- "<p>When specifying a number of days or a date, the snapshot selected for comparison is " +
- " the first one available inside the corresponding time range. </p>" +
- "<p>Changing this property only takes effect after subsequent project inspections.<p/>",
- project = false,
- global = true,
- defaultValue = CoreProperties.TIMEMACHINE_DEFAULT_PERIOD_1,
- category = CoreProperties.CATEGORY_DIFFERENTIAL_VIEWS),
- @Property(
- key = "sonar.timemachine.period2",
- name = "Period 2",
- description = "See the property 'Period 1'",
- project = false,
- global = true,
- defaultValue = CoreProperties.TIMEMACHINE_DEFAULT_PERIOD_2,
- category = CoreProperties.CATEGORY_DIFFERENTIAL_VIEWS),
- @Property(
- key = "sonar.timemachine.period3",
- name = "Period 3",
- description = "See the property 'Period 1'",
- project = false,
- global = true,
- defaultValue = CoreProperties.TIMEMACHINE_DEFAULT_PERIOD_3,
- category = CoreProperties.CATEGORY_DIFFERENTIAL_VIEWS),
- @Property(
- key = "sonar.timemachine.period4",
- name = "Period 4",
- description = "Period used to compare measures and track new violations. This property is specific to the project. Values are : " +
- "<ul class='bullet'><li>Number of days before analysis, for example 5.</li><li>A custom date. Format is yyyy-MM-dd, " +
- "for example 2010-12-25</li><li>'previous_analysis' to compare to previous analysis</li>" +
- "<li>'previous_version' to compare to the previous version in the project history</li><li>A version, for example 1.2</li></ul>" +
- "<p>When specifying a number of days or a date, the snapshot selected for comparison is the first one available inside the corresponding time range. </p>" +
- "<p>Changing this property only takes effect after subsequent project inspections.<p/>",
- project = true,
- global = false,
- defaultValue = CoreProperties.TIMEMACHINE_DEFAULT_PERIOD_4,
- category = CoreProperties.CATEGORY_DIFFERENTIAL_VIEWS),
- @Property(
- key = "sonar.timemachine.period5",
- name = "Period 5",
- description = "See the property 'Period 4'",
- project = true,
- global = false,
- defaultValue = CoreProperties.TIMEMACHINE_DEFAULT_PERIOD_5,
- category = CoreProperties.CATEGORY_DIFFERENTIAL_VIEWS),
- @Property(
key = CoreProperties.DRY_RUN,
defaultValue = "false",
name = "Dry Run",
@@ -488,8 +325,60 @@ public final class CorePlugin extends SonarPlugin {
extensions.addAll(ExclusionProperties.definitions());
extensions.addAll(IgnoreIssuesPlugin.getExtensions());
extensions.addAll(CoverageMeasurementFilter.getPropertyDefinitions());
+ extensions.addAll(PastSnapshotFinder.getPropertyDefinitions());
+ extensions.addAll(propertyDefinitions());
return extensions.build();
}
+
+ static List<PropertyDefinition> propertyDefinitions() {
+ return Arrays.asList(
+ PropertyDefinition.builder(CoreProperties.CORE_VIOLATION_LOCALE_PROPERTY)
+ .defaultValue("en")
+ .name("Locale used for issue messages")
+ .description("Locale to be used when generating issue messages. It's up to each rule engine to support this global internationalization property")
+ .onQualifiers(Qualifiers.PROJECT)
+ .category(CoreProperties.CATEGORY_GENERAL)
+ .subCategory(CoreProperties.SUBCATEGORY_L10N)
+ .build(),
+
+ PropertyDefinition.builder(CoreProperties.CORE_ALLOW_USERS_TO_SIGNUP_PROPERTY)
+ .defaultValue("" + CoreProperties.CORE_ALLOW_USERS_TO_SIGNUP_DEAULT_VALUE)
+ .name("Allow users to sign up online")
+ .description("Users can sign up online.")
+ .type(PropertyType.BOOLEAN)
+ .category(CoreProperties.CATEGORY_GENERAL)
+ .subCategory(CoreProperties.SUBCATEGORY_SECURITY)
+ .build(),
+
+ PropertyDefinition.builder(CoreProperties.CORE_DEFAULT_GROUP)
+ .defaultValue(CoreProperties.CORE_DEFAULT_GROUP_DEFAULT_VALUE)
+ .name("Default user group")
+ .description("Any new users will automatically join this group.")
+ .category(CoreProperties.CATEGORY_GENERAL)
+ .subCategory(CoreProperties.SUBCATEGORY_SECURITY)
+ .build(),
+
+ PropertyDefinition.builder(CoreProperties.CORE_IMPORT_SOURCES_PROPERTY)
+ .defaultValue("" + CoreProperties.CORE_IMPORT_SOURCES_DEFAULT_VALUE)
+ .name("Import sources")
+ .description("Set to false if sources should not be imported and therefore not available in the Web UI (e.g. for security reasons).")
+ .type(PropertyType.BOOLEAN)
+ .onQualifiers(Qualifiers.PROJECT, Qualifiers.MODULE)
+ .category(CoreProperties.CATEGORY_GENERAL)
+ .subCategory(CoreProperties.SUBCATEGORY_SECURITY)
+ .build(),
+
+ PropertyDefinition.builder(CoreProperties.CORE_FORCE_AUTHENTICATION_PROPERTY)
+ .defaultValue("" + CoreProperties.CORE_FORCE_AUTHENTICATION_DEFAULT_VALUE)
+ .name("Force user authentication")
+ .description("Forcing user authentication stops un-logged users to access SonarQube.")
+ .type(PropertyType.BOOLEAN)
+ .category(CoreProperties.CATEGORY_GENERAL)
+ .subCategory(CoreProperties.SUBCATEGORY_SECURITY)
+ .build()
+ );
+ }
+
}
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
index 8a881642bbf..80059e7f618 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
@@ -703,6 +703,11 @@ settings.save_category=Save {0} Settings
property.category.email=Email
property.category.encryption=Encryption
property.category.general=General
+property.category.general.security=Security
+property.category.general.duplications=Duplications
+property.category.general.differentialViews=Differential Views
+property.category.general.localization=Localization
+property.category.general.databaseCleaner=Database Cleaner
property.category.security=Security
property.category.java=Java
property.category.differentialViews=Differential Views
diff --git a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java
index 71edec05f83..ec991de112e 100644
--- a/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java
+++ b/plugins/sonar-cpd-plugin/src/main/java/org/sonar/plugins/cpd/CpdPlugin.java
@@ -40,7 +40,8 @@ public final class CpdPlugin extends SonarPlugin {
.name("Cross project duplication detection")
.description("SonarQube supports the detection of cross project duplications. Activating this property will slightly increase each SonarQube analysis time.")
.onQualifiers(Qualifiers.PROJECT, Qualifiers.MODULE)
- .category(CoreProperties.CATEGORY_DUPLICATIONS)
+ .category(CoreProperties.CATEGORY_GENERAL)
+ .subCategory(CoreProperties.SUBCATEGORY_DUPLICATIONS)
.type(PropertyType.BOOLEAN)
.build(),
PropertyDefinition.builder(CoreProperties.CPD_SKIP_PROPERTY)
@@ -48,7 +49,8 @@ public final class CpdPlugin extends SonarPlugin {
.name("Skip")
.description("Disable detection of duplications")
.hidden()
- .category(CoreProperties.CATEGORY_DUPLICATIONS)
+ .category(CoreProperties.CATEGORY_GENERAL)
+ .subCategory(CoreProperties.SUBCATEGORY_DUPLICATIONS)
.type(PropertyType.BOOLEAN)
.build(),
PropertyDefinition.builder(CoreProperties.CPD_EXCLUSIONS)
diff --git a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DbCleanerPlugin.java b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DbCleanerPlugin.java
index 5a0e48fb96a..975cdccc8ff 100644
--- a/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DbCleanerPlugin.java
+++ b/plugins/sonar-dbcleaner-plugin/src/main/java/org/sonar/plugins/dbcleaner/DbCleanerPlugin.java
@@ -20,6 +20,7 @@
package org.sonar.plugins.dbcleaner;
import com.google.common.collect.ImmutableList;
+import org.sonar.api.CoreProperties;
import org.sonar.api.PropertyType;
import org.sonar.api.SonarPlugin;
import org.sonar.api.config.PropertyDefinition;
@@ -45,6 +46,8 @@ public final class DbCleanerPlugin extends SonarPlugin {
.description("If set to true, no history is kept at directory/package level. Setting this to false can cause database bloat.")
.type(PropertyType.BOOLEAN)
.onQualifiers(Qualifiers.PROJECT)
+ .category(CoreProperties.CATEGORY_GENERAL)
+ .subCategory(CoreProperties.SUBCATEGORY_DATABASE_CLEANER)
.index(1)
.build(),
@@ -54,6 +57,8 @@ public final class DbCleanerPlugin extends SonarPlugin {
.description("Issues that have been closed for more than this number of days will be deleted.")
.type(PropertyType.INTEGER)
.onQualifiers(Qualifiers.PROJECT)
+ .category(CoreProperties.CATEGORY_GENERAL)
+ .subCategory(CoreProperties.SUBCATEGORY_DATABASE_CLEANER)
.index(2)
.build(),
@@ -64,6 +69,8 @@ public final class DbCleanerPlugin extends SonarPlugin {
+ "the DbCleaner keeps the most recent one and fully deletes the other ones.")
.type(PropertyType.INTEGER)
.onQualifiers(Qualifiers.PROJECT)
+ .category(CoreProperties.CATEGORY_GENERAL)
+ .subCategory(CoreProperties.SUBCATEGORY_DATABASE_CLEANER)
.index(3)
.build(),
@@ -74,6 +81,8 @@ public final class DbCleanerPlugin extends SonarPlugin {
+ "the DbCleaner keeps the most recent one and fully deletes the other ones")
.type(PropertyType.INTEGER)
.onQualifiers(Qualifiers.PROJECT)
+ .category(CoreProperties.CATEGORY_GENERAL)
+ .subCategory(CoreProperties.SUBCATEGORY_DATABASE_CLEANER)
.index(4)
.build(),
@@ -84,6 +93,8 @@ public final class DbCleanerPlugin extends SonarPlugin {
+ "the DbCleaner keeps the most recent one and fully deletes the other ones.")
.type(PropertyType.INTEGER)
.onQualifiers(Qualifiers.PROJECT)
+ .category(CoreProperties.CATEGORY_GENERAL)
+ .subCategory(CoreProperties.SUBCATEGORY_DATABASE_CLEANER)
.index(5)
.build(),
@@ -93,6 +104,8 @@ public final class DbCleanerPlugin extends SonarPlugin {
.description("After this number of weeks, all snapshots are fully deleted.")
.type(PropertyType.INTEGER)
.onQualifiers(Qualifiers.PROJECT)
+ .category(CoreProperties.CATEGORY_GENERAL)
+ .subCategory(CoreProperties.SUBCATEGORY_DATABASE_CLEANER)
.index(6)
.build()
);