diff options
author | Dimitris Kavvathas <dimitris.kavvathas@sonarsource.com> | 2023-03-09 17:19:37 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-03-13 20:02:45 +0000 |
commit | dd791e68ca7a5b0375e7cba70a2f8f27d4c75c26 (patch) | |
tree | a84c55cd9df1cbfc9958e22122f2bc8d3c080ed0 /server/sonar-webserver-core/src/main/java | |
parent | 82c7e9e96b598e50cdc90f7927213d21e7c6ff10 (diff) | |
download | sonarqube-dd791e68ca7a5b0375e7cba70a2f8f27d4c75c26.tar.gz sonarqube-dd791e68ca7a5b0375e7cba70a2f8f27d4c75c26.zip |
SONAR-18638 Drop deprecated fields in Rules WS API.
Drop "effortToFixDescription" and replace with "gapDescription".
Drop "debtRemFnCoeff" and replace with "remFnGapMultiplier".
Drop "defaultDebtRemFnCoeff" and replace with "defaultRemFnGapMultiplier".
Drop "debtRemFnOffset" and replace with "remFnBaseEffort".
Drop "defaultDebtRemFnOffset" and replace with "defaultRemFnBaseEffort".
Correct the version when the field 'scope' was added.
Drop "debtOverloaded" and replace with "remFnOverloaded".
Deprecate "defaultDebtRemFnType" and "debtRemFnType" and replace with "defaultRemFnType" and "remFnType" accordingly.
Deprecate "defaultDebtRemFn" and "debtRemFn" and replace with "defaultRemFn" and "remFn" accordingly.
Diffstat (limited to 'server/sonar-webserver-core/src/main/java')
-rw-r--r-- | server/sonar-webserver-core/src/main/java/org/sonar/server/rule/RegisterRules.java | 8 | ||||
-rw-r--r-- | server/sonar-webserver-core/src/main/java/org/sonar/server/rule/Rule.java | 110 |
2 files changed, 4 insertions, 114 deletions
diff --git a/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/RegisterRules.java b/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/RegisterRules.java index 2ef6a85b902..6dfc0e417fa 100644 --- a/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/RegisterRules.java +++ b/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/RegisterRules.java @@ -547,7 +547,7 @@ public class RegisterRules implements Startable { } private static boolean mergeDebtDefinitions(RuleDto dto, @Nullable String remediationFunction, - @Nullable String remediationCoefficient, @Nullable String remediationOffset, @Nullable String effortToFixDescription) { + @Nullable String remediationCoefficient, @Nullable String remediationOffset, @Nullable String gapDescription) { boolean changed = false; if (!Objects.equals(dto.getDefRemediationFunction(), remediationFunction)) { @@ -562,8 +562,8 @@ public class RegisterRules implements Startable { dto.setDefRemediationBaseEffort(remediationOffset); changed = true; } - if (!Objects.equals(dto.getGapDescription(), effortToFixDescription)) { - dto.setGapDescription(effortToFixDescription); + if (!Objects.equals(dto.getGapDescription(), gapDescription)) { + dto.setGapDescription(gapDescription); changed = true; } return changed; @@ -809,7 +809,7 @@ public class RegisterRules implements Startable { return changes; } - private Set<String> getExistingAndRenamedRepositories(RegisterRulesContext recorder, Collection<RulesDefinition.Repository> context) { + private static Set<String> getExistingAndRenamedRepositories(RegisterRulesContext recorder, Collection<RulesDefinition.Repository> context) { return Stream.concat( context.stream().map(RulesDefinition.ExtendedRepository::key), recorder.getRenamed().map(Map.Entry::getValue).map(RuleKey::repository)) diff --git a/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/Rule.java b/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/Rule.java deleted file mode 100644 index 8cdb0d1f5be..00000000000 --- a/server/sonar-webserver-core/src/main/java/org/sonar/server/rule/Rule.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2023 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.server.rule; - -import org.sonar.api.rule.RuleKey; -import org.sonar.api.rule.RuleStatus; -import org.sonar.api.server.debt.DebtRemediationFunction; - -import javax.annotation.CheckForNull; - -import java.util.Date; -import java.util.List; - -/** - * @since 4.4 - */ -public interface Rule { - - RuleKey key(); - - String language(); - - String name(); - - @CheckForNull - String htmlDescription(); - - @CheckForNull - String markdownDescription(); - - String effortToFixDescription(); - - /** - * Default severity when activated on a Quality profile - * - * @see org.sonar.api.rule.Severity - */ - String severity(); - - /** - * @see org.sonar.api.rule.RuleStatus - */ - RuleStatus status(); - - boolean isTemplate(); - - @CheckForNull - RuleKey templateKey(); - - /** - * Tags that can be customized by administrators - */ - List<String> tags(); - - /** - * Read-only tags defined by plugins - */ - List<String> systemTags(); - - List<RuleParam> params(); - - @CheckForNull - RuleParam param(final String key); - - boolean debtOverloaded(); - - @CheckForNull - DebtRemediationFunction debtRemediationFunction(); - - @CheckForNull - DebtRemediationFunction defaultDebtRemediationFunction(); - - Date createdAt(); - - Date updatedAt(); - - @CheckForNull - String internalKey(); - - @CheckForNull - String markdownNote(); - - @CheckForNull - String noteLogin(); - - @CheckForNull - Date noteCreatedAt(); - - @CheckForNull - Date noteUpdatedAt(); - - boolean isManual(); -} |