*/
public class DatabaseVersion implements BatchComponent, ServerComponent {
- public static final int LAST_VERSION = 519;
+ public static final int LAST_VERSION = 520;
public static enum Status {
UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
+import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.sonar.check.Cardinality;
+import javax.annotation.CheckForNull;
+import javax.annotation.Nullable;
+
import java.util.Date;
public final class RuleDto {
private Cardinality cardinality;
private String language;
private Integer parentId;
- private Date createdAt;
- private Date updatedAt;
private String noteData;
private String noteUserLogin;
private Date noteCreatedAt;
private Date noteUpdatedAt;
+ private Integer characteristicId;
+ private Integer defaultCharacteristicId;
+ private String remediationFunction;
+ private String defaultRemediationFunction;
+ private String remediationFactor;
+ private String defaultRemediationFactor;
+ private String remediationOffset;
+ private String defaultRemediationOffset;
+ private String effortToFixL10nKey;
+ private Date createdAt;
+ private Date updatedAt;
public Integer getId() {
return id;
return this;
}
- public Date getCreatedAt() {
- return createdAt;
- }
-
- public RuleDto setCreatedAt(Date createdAt) {
- this.createdAt = createdAt;
- return this;
- }
-
- public Date getUpdatedAt() {
- return updatedAt;
- }
-
- public RuleDto setUpdatedAt(Date updatedAt) {
- this.updatedAt = updatedAt;
- return this;
- }
-
public String getNoteData() {
return noteData;
}
return this;
}
+ @CheckForNull
+ public Integer getCharacteristicId() {
+ return characteristicId;
+ }
+
+ public RuleDto setCharacteristicId(@Nullable Integer characteristicId) {
+ this.characteristicId = characteristicId;
+ return this;
+ }
+
+ @CheckForNull
+ public Integer getDefaultCharacteristicId() {
+ return defaultCharacteristicId;
+ }
+
+ public RuleDto setDefaultCharacteristicId(@Nullable Integer defaultCharacteristicId) {
+ this.defaultCharacteristicId = defaultCharacteristicId;
+ return this;
+ }
+
+ @CheckForNull
+ public String getRemediationFunction() {
+ return remediationFunction;
+ }
+
+ public RuleDto setRemediationFunction(@Nullable String remediationFunction) {
+ this.remediationFunction = remediationFunction;
+ return this;
+ }
+
+ @CheckForNull
+ public String getDefaultRemediationFunction() {
+ return defaultRemediationFunction;
+ }
+
+ public RuleDto setDefaultRemediationFunction(@Nullable String defaultRemediationFunction) {
+ this.defaultRemediationFunction = defaultRemediationFunction;
+ return this;
+ }
+
+ @CheckForNull
+ public String getRemediationFactor() {
+ return remediationFactor;
+ }
+
+ public RuleDto setRemediationFactor(@Nullable String remediationFactor) {
+ this.remediationFactor = remediationFactor;
+ return this;
+ }
+
+ @CheckForNull
+ public String getDefaultRemediationFactor() {
+ return defaultRemediationFactor;
+ }
+
+ public RuleDto setDefaultRemediationFactor(@Nullable String defaultRemediationFactor) {
+ this.defaultRemediationFactor = defaultRemediationFactor;
+ return this;
+ }
+
+ @CheckForNull
+ public String getRemediationOffset() {
+ return remediationOffset;
+ }
+
+ public RuleDto setRemediationOffset(@Nullable String remediationOffset) {
+ this.remediationOffset = remediationOffset;
+ return this;
+ }
+
+ @CheckForNull
+ public String getDefaultRemediationOffset() {
+ return defaultRemediationOffset;
+ }
+
+ public RuleDto setDefaultRemediationOffset(@Nullable String defaultRemediationOffset) {
+ this.defaultRemediationOffset = defaultRemediationOffset;
+ return this;
+ }
+
+ @CheckForNull
+ public String getEffortToFixL10nKey() {
+ return effortToFixL10nKey;
+ }
+
+ public RuleDto setEffortToFixL10nKey(@Nullable String effortToFixL10nKey) {
+ this.effortToFixL10nKey = effortToFixL10nKey;
+ return this;
+ }
+
+ public Date getCreatedAt() {
+ return createdAt;
+ }
+
+ public RuleDto setCreatedAt(Date createdAt) {
+ this.createdAt = createdAt;
+ return this;
+ }
+
+ public Date getUpdatedAt() {
+ return updatedAt;
+ }
+
+ public RuleDto setUpdatedAt(Date updatedAt) {
+ this.updatedAt = updatedAt;
+ return this;
+ }
+
@Override
public boolean equals(Object obj) {
if (!(obj instanceof RuleDto)) {
@Override
public String toString() {
- // Note that ReflectionToStringBuilder will not work here - see SONAR-3077
- return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
- .append("id", id)
- .append("name", name)
- .append("key", ruleKey)
- .append("configKey", configKey)
- .append("plugin", repositoryKey)
- .append("severity", getSeverityString())
- .append("cardinality", cardinality)
- .append("status", status)
- .append("language", language)
- .append("parentId", parentId)
- .toString();
+ return new ReflectionToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).toString();
}
}
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('517');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('518');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('519');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('520');
INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT, REMEMBER_TOKEN, REMEMBER_TOKEN_EXPIRES_AT) VALUES (1, 'admin', 'Administrator', '', 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '2011-09-26 22:27:48.0', '2011-09-26 22:27:48.0', null, null);
ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2;
"NAME" VARCHAR(200),
"STATUS" VARCHAR(40),
"LANGUAGE" VARCHAR(20),
- "CREATED_AT" TIMESTAMP,
- "UPDATED_AT" TIMESTAMP,
+ "NOTE_DATA" CLOB(2147483647),
+ "NOTE_USER_LOGIN" VARCHAR(40),
"NOTE_CREATED_AT" TIMESTAMP,
"NOTE_UPDATED_AT" TIMESTAMP,
- "NOTE_USER_LOGIN" VARCHAR(40),
- "NOTE_DATA" CLOB(2147483647)
+ "CHARACTERISTIC_ID" INTEGER,
+ "DEFAULT_CHARACTERISTIC_ID" INTEGER,
+ "REMEDIATION_FUNCTION" VARCHAR(20),
+ "DEFAULT_REMEDIATION_FUNCTION" VARCHAR(20),
+ "REMEDIATION_FACTOR" VARCHAR(20),
+ "DEFAULT_REMEDIATION_FACTOR" VARCHAR(20),
+ "REMEDIATION_OFFSET" VARCHAR(20),
+ "DEFAULT_REMEDIATION_OFFSET" VARCHAR(20),
+ "EFFORT_TO_FIX_L10N_KEY" VARCHAR(100),
+ "CREATED_AT" TIMESTAMP,
+ "UPDATED_AT" TIMESTAMP
);
CREATE TABLE "RULE_TAGS" (
cardinality,
language as "language",
parent_id as "parentId",
- created_at as "createdAt",
- updated_at as "updatedAt",
note_data as "noteData",
note_user_login as "noteUserLogin",
note_created_at as "noteCreatedAt",
- note_updated_at as "noteUpdatedAt"
+ note_updated_at as "noteUpdatedAt",
+ characteristic_id as "characteristicId",
+ default_characteristic_id as "defaultCharacteristicId",
+ remediation_function as "remediationFunction",
+ default_remediation_function as "defaultRemediationFunction",
+ remediation_factor as "remediationFactor",
+ default_remediation_factor as "defaultRemediationFactor",
+ remediation_offset as "remediationOffset",
+ default_remediation_offset as "defaultRemediationOffset",
+ effort_to_fix_l10n_key as "effortToFixL10nKey",
+ created_at as "createdAt",
+ updated_at as "updatedAt"
</sql>
<select id="selectAll" resultType="Rule">
cardinality=#{cardinality},
language=#{language},
parent_id=#{parentId},
- updated_at=#{updatedAt},
note_data=#{noteData},
note_user_login=#{noteUserLogin},
note_created_at=#{noteCreatedAt},
- note_updated_at=#{noteUpdatedAt}
+ note_updated_at=#{noteUpdatedAt},
+ characteristic_id=#{characteristicId},
+ default_characteristic_id=#{defaultCharacteristicId},
+ remediation_function=#{remediationFunction},
+ default_remediation_function=#{defaultRemediationFunction},
+ remediation_factor=#{remediationFactor},
+ default_remediation_factor=#{defaultRemediationFactor},
+ remediation_offset=#{remediationOffset},
+ default_remediation_offset=#{defaultRemediationOffset},
+ effort_to_fix_l10n_key=#{effortToFixL10nKey},
+ updated_at=#{updatedAt}
WHERE id=#{id}
</update>
<sql id="insertColumns">
- (plugin_rule_key, plugin_name, description, status, name, plugin_config_key, priority, cardinality, language,
- parent_id, created_at, updated_at)
+ (plugin_rule_key, plugin_name, description, status, name, plugin_config_key, priority, cardinality, language, parent_id,
+ characteristic_id, default_characteristic_id, remediation_function, default_remediation_function,
+ remediation_factor, default_remediation_factor, remediation_offset, default_remediation_offset,
+ effort_to_fix_l10n_key,
+ created_at, updated_at)
</sql>
<insert id="insert" parameterType="Rule" keyColumn="id" useGeneratedKeys="true" keyProperty="id">
insert into rules <include refid="insertColumns"/>
values (#{ruleKey}, #{repositoryKey}, #{description}, #{status}, #{name}, #{configKey},
- #{severity}, #{cardinality}, #{language}, #{parentId}, #{createdAt}, #{updatedAt})
+ #{severity}, #{cardinality}, #{language}, #{parentId},
+ #{characteristicId}, #{defaultCharacteristicId}, #{remediationFunction}, #{defaultRemediationFunction},
+ #{remediationFactor}, #{defaultRemediationFactor}, #{remediationOffset}, #{defaultRemediationOffset},
+ #{effortToFixL10nKey},
+ #{createdAt}, #{updatedAt})
</insert>
<insert id="batchInsert" parameterType="Rule" useGeneratedKeys="false">
insert into rules <include refid="insertColumns"/>
values (#{ruleKey}, #{repositoryKey}, #{description}, #{status}, #{name}, #{configKey},
- #{severity}, #{cardinality}, #{language}, #{parentId}, #{createdAt}, #{updatedAt})
+ #{severity}, #{cardinality}, #{language}, #{parentId},
+ #{characteristicId}, #{defaultCharacteristicId}, #{remediationFunction}, #{defaultRemediationFunction},
+ #{remediationFactor}, #{defaultRemediationFactor}, #{remediationOffset}, #{defaultRemediationOffset},
+ #{effortToFixL10nKey},
+ #{createdAt}, #{updatedAt})
</insert>
<delete id="deleteParams" parameterType="Integer" >
import org.sonar.check.Cardinality;
import org.sonar.core.persistence.AbstractDaoTestCase;
-import java.util.Date;
import java.util.List;
import static org.fest.assertions.Assertions.assertThat;
}
@Test
- public void testSelectAll() throws Exception {
+ public void select_all() throws Exception {
setupData("selectAll");
List<RuleDto> ruleDtos = dao.selectAll();
assertThat(ruleDto.getStatus()).isEqualTo(Rule.STATUS_READY);
assertThat(ruleDto.getRepositoryKey()).isEqualTo("checkstyle");
assertThat(ruleDto.getNoteData()).isEqualTo("Rule note with accents \u00e9\u00e8\u00e0");
+ assertThat(ruleDto.getCharacteristicId()).isEqualTo(100);
+ assertThat(ruleDto.getDefaultCharacteristicId()).isEqualTo(101);
+ assertThat(ruleDto.getRemediationFunction()).isEqualTo("linear");
+ assertThat(ruleDto.getDefaultRemediationFunction()).isEqualTo("linear_offset");
+ assertThat(ruleDto.getRemediationFactor()).isEqualTo("1h");
+ assertThat(ruleDto.getDefaultRemediationFactor()).isEqualTo("5d");
+ assertThat(ruleDto.getRemediationOffset()).isEqualTo("5min");
+ assertThat(ruleDto.getDefaultRemediationOffset()).isEqualTo("10h");
+ assertThat(ruleDto.getEffortToFixL10nKey()).isEqualTo("squid.S115.effortToFix");
}
@Test
- public void testSelectById() throws Exception {
+ public void select_by_id() throws Exception {
setupData("selectById");
RuleDto ruleDto = dao.selectById(2);
}
@Test
- public void testSelectNonManual() throws Exception {
+ public void select_non_manual() throws Exception {
setupData("selectNonManual");
SqlSession session = getMyBatis().openSession();
List<RuleDto> ruleDtos = dao.selectNonManual(session);
.setCardinality(Cardinality.MULTIPLE)
.setLanguage("dart")
.setParentId(3)
- .setUpdatedAt(DateUtils.parseDate("2013-12-17"))
.setNoteData("My note")
.setNoteUserLogin("admin")
.setNoteCreatedAt(DateUtils.parseDate("2013-12-19"))
- .setNoteUpdatedAt(DateUtils.parseDate("2013-12-20"));
+ .setNoteUpdatedAt(DateUtils.parseDate("2013-12-20"))
+ .setCharacteristicId(100)
+ .setDefaultCharacteristicId(101)
+ .setRemediationFunction("linear")
+ .setDefaultRemediationFunction("linear_offset")
+ .setRemediationFactor("1h")
+ .setDefaultRemediationFactor("5d")
+ .setRemediationOffset("5min")
+ .setDefaultRemediationOffset("10h")
+ .setEffortToFixL10nKey("squid.S115.effortToFix")
+ .setUpdatedAt(DateUtils.parseDate("2013-12-17"));
dao.update(ruleToUpdate);
}
@Test
- public void testInsert() {
- setupData("insert");
- RuleDto ruleToInsert = new RuleDto();
- String newRuleKey = "NewRuleKey";
- String newRepositoryKey = "plugin";
- String newName = "new name";
- String newDescription = "new description";
- String newStatus = Rule.STATUS_DEPRECATED;
- String newConfigKey = "NewConfigKey";
- String newSeverity = Severity.INFO;
- Cardinality newCardinality = Cardinality.MULTIPLE;
- String newLanguage = "dart";
- Date updatedAt = new Date();
- Integer newParentId = 3;
-
- ruleToInsert.setRuleKey(newRuleKey);
- ruleToInsert.setRepositoryKey(newRepositoryKey);
- ruleToInsert.setName(newName);
- ruleToInsert.setDescription(newDescription);
- ruleToInsert.setStatus(newStatus);
- ruleToInsert.setConfigKey(newConfigKey);
- ruleToInsert.setSeverity(Severity.INFO);
- ruleToInsert.setCardinality(newCardinality);
- ruleToInsert.setLanguage(newLanguage);
- ruleToInsert.setUpdatedAt(updatedAt);
- ruleToInsert.setParentId(newParentId);
+ public void insert() {
+ setupData("empty");
+
+ RuleDto ruleToInsert = new RuleDto()
+ .setId(1)
+ .setRuleKey("NewRuleKey")
+ .setRepositoryKey("plugin")
+ .setName("new name")
+ .setDescription("new description")
+ .setStatus(Rule.STATUS_DEPRECATED)
+ .setConfigKey("NewConfigKey")
+ .setSeverity(Severity.INFO)
+ .setCardinality(Cardinality.MULTIPLE)
+ .setLanguage("dart")
+ .setParentId(3)
+ .setCharacteristicId(100)
+ .setDefaultCharacteristicId(101)
+ .setRemediationFunction("linear")
+ .setDefaultRemediationFunction("linear_offset")
+ .setRemediationFactor("1h")
+ .setDefaultRemediationFactor("5d")
+ .setRemediationOffset("5min")
+ .setDefaultRemediationOffset("10h")
+ .setEffortToFixL10nKey("squid.S115.effortToFix")
+ .setCreatedAt(DateUtils.parseDate("2013-12-16"))
+ .setUpdatedAt(DateUtils.parseDate("2013-12-17"));
+
dao.insert(ruleToInsert);
- List<RuleDto> ruleDtos = dao.selectAll();
- assertThat(ruleDtos.size()).isEqualTo(1);
- RuleDto insertedRule = ruleDtos.get(0);
- // First inserted rule, auto generated ID should be 1
- assertThat(insertedRule.getId()).isEqualTo(1);
- assertThat(insertedRule.getRuleKey()).isEqualTo(newRuleKey);
- assertThat(insertedRule.getRepositoryKey()).isEqualTo(newRepositoryKey);
- assertThat(insertedRule.getName()).isEqualTo(newName);
- assertThat(insertedRule.getDescription()).isEqualTo(newDescription);
- assertThat(insertedRule.getStatus()).isEqualTo(newStatus);
- assertThat(insertedRule.getConfigKey()).isEqualTo(newConfigKey);
- assertThat(insertedRule.getSeverityString()).isEqualTo(newSeverity);
- assertThat(insertedRule.getCardinality()).isEqualTo(newCardinality);
- assertThat(insertedRule.getLanguage()).isEqualTo(newLanguage);
- assertThat(insertedRule.getParentId()).isEqualTo(newParentId);
+ checkTables("insert", "rules");
}
@Test
- public void testInsertAll() {
- setupData("insert");
- RuleDto ruleToInsert1 = new RuleDto();
- String newRuleKey = "NewRuleKey1";
- String newRepositoryKey = "plugin1";
- String newName = "new name1";
- String newDescription = "new description1";
- String newStatus = Rule.STATUS_DEPRECATED;
- String newConfigKey = "NewConfigKey1";
- String newSeverity = Severity.INFO;
- Cardinality newCardinality = Cardinality.MULTIPLE;
- String newLanguage = "dart";
- Date createdAt = new Date();
- Date updatedAt = new Date();
-
- ruleToInsert1.setRuleKey(newRuleKey);
- ruleToInsert1.setRepositoryKey(newRepositoryKey);
- ruleToInsert1.setName(newName);
- ruleToInsert1.setDescription(newDescription);
- ruleToInsert1.setStatus(newStatus);
- ruleToInsert1.setConfigKey(newConfigKey);
- ruleToInsert1.setSeverity(newSeverity);
- ruleToInsert1.setCardinality(newCardinality);
- ruleToInsert1.setLanguage(newLanguage);
- ruleToInsert1.setCreatedAt(createdAt);
- ruleToInsert1.setUpdatedAt(updatedAt);
-
- RuleDto ruleToInsert2 = new RuleDto();
- String newRuleKey1 = "NewRuleKey2";
- String newRepositoryKey1 = "plugin2";
- String newName1 = "new name2";
- String newDescription1 = "new description2";
- String newStatus1 = Rule.STATUS_DEPRECATED;
- String newConfigKey1 = "NewConfigKey2";
- String newSeverity1 = Severity.INFO;
- Cardinality newCardinality1 = Cardinality.MULTIPLE;
- String newLanguage1 = "dart";
- Date createdAt1 = new Date();
- Date updatedAt1 = new Date();
-
- ruleToInsert2.setRuleKey(newRuleKey1);
- ruleToInsert2.setRepositoryKey(newRepositoryKey1);
- ruleToInsert2.setName(newName1);
- ruleToInsert2.setDescription(newDescription1);
- ruleToInsert2.setStatus(newStatus1);
- ruleToInsert2.setConfigKey(newConfigKey1);
- ruleToInsert2.setSeverity(newSeverity1);
- ruleToInsert2.setCardinality(newCardinality1);
- ruleToInsert2.setLanguage(newLanguage1);
- ruleToInsert2.setCreatedAt(createdAt1);
- ruleToInsert2.setUpdatedAt(updatedAt1);
+ public void insert_all() {
+ setupData("empty");
+
+ RuleDto ruleToInsert1 = new RuleDto()
+ .setId(1)
+ .setRuleKey("NewRuleKey")
+ .setRepositoryKey("plugin")
+ .setName("new name")
+ .setDescription("new description")
+ .setStatus(Rule.STATUS_DEPRECATED)
+ .setConfigKey("NewConfigKey")
+ .setSeverity(Severity.INFO)
+ .setCardinality(Cardinality.MULTIPLE)
+ .setLanguage("dart")
+ .setParentId(3)
+ .setCharacteristicId(100)
+ .setDefaultCharacteristicId(101)
+ .setRemediationFunction("linear")
+ .setDefaultRemediationFunction("linear_offset")
+ .setRemediationFactor("1h")
+ .setDefaultRemediationFactor("5d")
+ .setRemediationOffset("5min")
+ .setDefaultRemediationOffset("10h")
+ .setEffortToFixL10nKey("squid.S115.effortToFix")
+ .setCreatedAt(DateUtils.parseDate("2013-12-16"))
+ .setUpdatedAt(DateUtils.parseDate("2013-12-17"));
+
+ RuleDto ruleToInsert2 = new RuleDto()
+ .setId(2)
+ .setRuleKey("NewRuleKey2")
+ .setRepositoryKey("plugin2")
+ .setName("new name2")
+ .setDescription("new description2")
+ .setStatus(Rule.STATUS_BETA)
+ .setConfigKey("NewConfigKey2")
+ .setSeverity(Severity.MAJOR)
+ .setCardinality(Cardinality.SINGLE)
+ .setLanguage("js")
+ .setParentId(null)
+ .setCharacteristicId(102)
+ .setDefaultCharacteristicId(103)
+ .setRemediationFunction("linear_offset")
+ .setDefaultRemediationFunction("linear")
+ .setRemediationFactor("5d")
+ .setDefaultRemediationFactor("1h")
+ .setRemediationOffset("10h")
+ .setDefaultRemediationOffset("5min")
+ .setEffortToFixL10nKey("squid.S115.effortToFix2")
+ .setCreatedAt(DateUtils.parseDate("2013-12-14"))
+ .setUpdatedAt(DateUtils.parseDate("2013-12-15"));
dao.insert(ImmutableList.of(ruleToInsert1, ruleToInsert2));
- List<RuleDto> ruleDtos = dao.selectAll();
- assertThat(ruleDtos.size()).isEqualTo(2);
- assertThat(ruleDtos.get(0).getId()).isEqualTo(1);
- assertThat(ruleDtos.get(1).getId()).isEqualTo(2);
+ checkTables("insert_all", "rules");
}
@Test
- public void testSelectParameters() throws Exception {
+ public void select_parameters() throws Exception {
setupData("selectParameters");
List<RuleParamDto> ruleDtos = dao.selectParameters();
}
@Test
- public void testSelectParamsForRule() throws Exception {
+ public void select_params_for_rule() throws Exception {
setupData("selectParamsForRule");
int ruleId = 1;
List<RuleParamDto> ruleDtos = dao.selectParameters(ruleId);
--- /dev/null
+<dataset>
+
+</dataset>
--- /dev/null
+<!--
+ ~ SonarQube, open source software quality management tool.
+ ~ Copyright (C) 2008-2013 SonarSource
+ ~ mailto:contact AT sonarsource DOT com
+ ~
+ ~ SonarQube 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.
+ ~
+ ~ SonarQube 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.
+ -->
+
+<dataset>
+
+ <rules id="1" plugin_rule_key="NewRuleKey" plugin_name="plugin" name="new name" description="new description" status="DEPRECATED"
+ plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2013-12-16" updated_at="2013-12-17" parent_id="3"
+ note_data="[null]" note_user_login="[null]" note_created_at="[null]" note_updated_at="[null]"
+ characteristic_id="100" default_characteristic_id="101"
+ remediation_function="linear" default_remediation_function="linear_offset"
+ remediation_factor="1h" default_remediation_factor="5d"
+ remediation_offset="5min" default_remediation_offset="10h"
+ effort_to_fix_l10n_key="squid.S115.effortToFix"
+ />
+
+</dataset>
+++ /dev/null
-<dataset>
-
-</dataset>
--- /dev/null
+<!--
+ ~ SonarQube, open source software quality management tool.
+ ~ Copyright (C) 2008-2013 SonarSource
+ ~ mailto:contact AT sonarsource DOT com
+ ~
+ ~ SonarQube 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.
+ ~
+ ~ SonarQube 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.
+ -->
+
+<dataset>
+
+ <rules id="1" plugin_rule_key="NewRuleKey" plugin_name="plugin" name="new name" description="new description" status="DEPRECATED"
+ plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2013-12-16" updated_at="2013-12-17" parent_id="3"
+ note_data="[null]" note_user_login="[null]" note_created_at="[null]" note_updated_at="[null]"
+ characteristic_id="100" default_characteristic_id="101"
+ remediation_function="linear" default_remediation_function="linear_offset"
+ remediation_factor="1h" default_remediation_factor="5d"
+ remediation_offset="5min" default_remediation_offset="10h"
+ effort_to_fix_l10n_key="squid.S115.effortToFix"
+ />
+
+ <rules id="2" plugin_rule_key="NewRuleKey2" plugin_name="plugin2" name="new name2" description="new description2" status="BETA"
+ plugin_config_key="NewConfigKey2" priority="2" cardinality="SINGLE" language="js" created_at="2013-12-14" updated_at="2013-12-15" parent_id="[null]"
+ note_data="[null]" note_user_login="[null]" note_created_at="[null]" note_updated_at="[null]"
+ characteristic_id="102" default_characteristic_id="103"
+ remediation_function="linear_offset" default_remediation_function="linear"
+ remediation_factor="5d" default_remediation_factor="1h"
+ remediation_offset="10h" default_remediation_offset="5min"
+ effort_to_fix_l10n_key="squid.S115.effortToFix2"
+ />
+
+</dataset>
<dataset>
<rules id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" status="READY"
- note_data="Rule note with accents éèà " note_user_login="polop.palap" note_created_at="2013-12-25"/>
+ note_data="Rule note with accents éèà " note_user_login="polop.palap" note_created_at="2013-12-25"
+ characteristic_id="100" default_characteristic_id="101"
+ remediation_function="linear" default_remediation_function="linear_offset"
+ remediation_factor="1h" default_remediation_factor="5d"
+ remediation_offset="5min" default_remediation_offset="10h"
+ effort_to_fix_l10n_key="squid.S115.effortToFix"
+ />
</dataset>
<rules id="1" plugin_rule_key="NewRuleKey" plugin_name="plugin" name="new name" description="new description" status="DEPRECATED"
plugin_config_key="NewConfigKey" priority="0" cardinality="MULTIPLE" language="dart" created_at="2011-04-25 01:05:00" updated_at="2013-12-17" parent_id="3"
- note_data="My note" note_user_login="admin" note_created_at="2013-12-19" note_updated_at="2013-12-20" />
+ note_data="My note" note_user_login="admin" note_created_at="2013-12-19" note_updated_at="2013-12-20"
+ characteristic_id="100" default_characteristic_id="101"
+ remediation_function="linear" default_remediation_function="linear_offset"
+ remediation_factor="1h" default_remediation_factor="5d"
+ remediation_offset="5min" default_remediation_offset="10h"
+ effort_to_fix_l10n_key="squid.S115.effortToFix"
+ />
<rules id="2" plugin_rule_key="Parent1" plugin_name="checkstyle" name="Parent Rule 1" description="Parent Rule 1" status="READY"
plugin_config_key="Parent1" priority="2" cardinality="SINGLE" language="golo" created_at="1981-10-24 15:20:00" updated_at="[null]" parent_id="[null]"
--- /dev/null
+/*
+ * SonarQube, open source software quality management tool.
+ * Copyright (C) 2008-2013 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * SonarQube 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.
+ *
+ * SonarQube 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.api.rule;
+
+/**
+ * @since 4.3
+ */
+public enum RemediationFunction {
+ LINEAR, LINEAR_OFFSET, CONSTANT_ISSUE
+}
import org.apache.commons.lang.StringUtils;
import org.slf4j.LoggerFactory;
import org.sonar.api.ServerExtension;
+import org.sonar.api.rule.RemediationFunction;
import org.sonar.api.rule.RuleStatus;
import org.sonar.api.rule.Severity;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
+
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
private String name, htmlDescription, internalKey, severity = Severity.MAJOR;
private boolean template;
private RuleStatus status = RuleStatus.defaultStatus();
+ private String characteristicKey;
+ private RemediationFunction remediationFunction;
+ private String remediationFactor;
+ private String remediationOffset;
+ private String effortToFixL10nKey;
private final Set<String> tags = Sets.newTreeSet();
private final Map<String, NewParam> paramsByKey = Maps.newHashMap();
return this;
}
+ public NewRule setCharacteristicKey(@Nullable String characteristicKey) {
+ // TODO validate characteristic exists and it's a sub characteristic
+ this.characteristicKey = characteristicKey;
+ return this;
+ }
+
+ public NewRule setRemediationFunction(@Nullable RemediationFunction remediationFunction) {
+ this.remediationFunction = remediationFunction;
+ return this;
+ }
+
+ public NewRule setRemediationFactor(@Nullable String remediationFactor) {
+ // TODO validate format
+ this.remediationFactor = remediationFactor;
+ return this;
+ }
+
+ public NewRule setRemediationOffset(@Nullable String remediationOffset) {
+ // TODO validate format
+ this.remediationOffset = remediationOffset;
+ return this;
+ }
+
+ public NewRule setEffortToFixL10nKey(@Nullable String effortToFixL10nKey) {
+ this.effortToFixL10nKey = effortToFixL10nKey;
+ return this;
+ }
+
public NewParam newParam(String paramKey) {
if (paramsByKey.containsKey(paramKey)) {
throw new IllegalArgumentException(String.format("The parameter '%s' is declared several times on the rule %s", paramKey, this));
private final Repository repository;
private final String repoKey, key, name, htmlDescription, internalKey, severity;
private final boolean template;
+ private final String characteristicKey;
+ private final RemediationFunction remediationFunction;
+ private final String remediationFactor;
+ private final String remediationOffset;
+ private final String effortToFixL10nKey;
private final Set<String> tags;
private final Map<String, Param> params;
private final RuleStatus status;
this.severity = newRule.severity;
this.template = newRule.template;
this.status = newRule.status;
+ this.characteristicKey = newRule.characteristicKey;
+ this.remediationFunction = newRule.remediationFunction;
+ this.remediationFactor = newRule.remediationFactor;
+ this.remediationOffset = newRule.remediationOffset;
+ this.effortToFixL10nKey = newRule.effortToFixL10nKey;
this.tags = ImmutableSortedSet.copyOf(newRule.tags);
ImmutableMap.Builder<String, Param> paramsBuilder = ImmutableMap.builder();
for (NewParam newParam : newRule.paramsByKey.values()) {
return status;
}
+ @CheckForNull
+ public String characteristicKey() {
+ return characteristicKey;
+ }
+
+ @CheckForNull
+ public RemediationFunction remediationFunction() {
+ return remediationFunction;
+ }
+
+ @CheckForNull
+ public String remediationFactor() {
+ return remediationFactor;
+ }
+
+ @CheckForNull
+ public String remediationOffset() {
+ return remediationOffset;
+ }
+
+ @CheckForNull
+ public String effortToFixL10nKey() {
+ return effortToFixL10nKey;
+ }
+
@CheckForNull
public Param param(String key) {
return params.get(key);
package org.sonar.api.server.rule;
import org.junit.Test;
+import org.sonar.api.rule.RemediationFunction;
import org.sonar.api.rule.RuleStatus;
import org.sonar.api.rule.Severity;
.setSeverity(Severity.BLOCKER)
.setInternalKey("/something")
.setStatus(RuleStatus.BETA)
+ .setCharacteristicKey("COMPILER")
+ .setRemediationFunction(RemediationFunction.LINEAR_OFFSET)
+ .setRemediationFactor("1h")
+ .setRemediationOffset("10min")
+ .setEffortToFixL10nKey("squid.S115.effortToFix")
.setTags("one", "two")
.addTags("two", "three", "four");
newFindbugs.newRule("ABC").setName("ABC").setHtmlDescription("ABC");
assertThat(npeRule.internalKey()).isEqualTo("/something");
assertThat(npeRule.template()).isFalse();
assertThat(npeRule.status()).isEqualTo(RuleStatus.BETA);
+ assertThat(npeRule.characteristicKey()).isEqualTo("COMPILER");
+ assertThat(npeRule.remediationFunction()).isEqualTo(RemediationFunction.LINEAR_OFFSET);
+ assertThat(npeRule.remediationFactor()).isEqualTo("1h");
+ assertThat(npeRule.remediationOffset()).isEqualTo("10min");
+ assertThat(npeRule.effortToFixL10nKey()).isEqualTo("squid.S115.effortToFix");
assertThat(npeRule.toString()).isEqualTo("[repository=findbugs, key=NPE]");
assertThat(npeRule.repository()).isSameAs(findbugs);
assertThat(rule.internalKey()).isNull();
assertThat(rule.status()).isEqualTo(RuleStatus.defaultStatus());
assertThat(rule.tags()).isEmpty();
+ assertThat(rule.characteristicKey()).isNull();
+ assertThat(rule.remediationFunction()).isNull();
+ assertThat(rule.remediationFactor()).isNull();
+ assertThat(rule.remediationOffset()).isNull();
}
@Test
import org.picocontainer.Startable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.sonar.api.rule.RemediationFunction;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.rules.Rule;
-import org.sonar.api.rules.RulePriority;
import org.sonar.api.server.rule.RuleDefinitions;
import org.sonar.api.utils.System2;
import org.sonar.api.utils.TimeProfiler;
}
private RuleDto enableAndInsert(Buffer buffer, SqlSession sqlSession, RuleDefinitions.Rule ruleDef) {
+ RemediationFunction remediationFunction = ruleDef.remediationFunction();
RuleDto ruleDto = new RuleDto()
.setCardinality(ruleDef.template() ? Cardinality.MULTIPLE : Cardinality.SINGLE)
.setConfigKey(ruleDef.internalKey())
.setName(ruleDef.name())
.setRepositoryKey(ruleDef.repository().key())
.setRuleKey(ruleDef.key())
- .setSeverity(RulePriority.valueOf(ruleDef.severity()).name())
+ .setSeverity(ruleDef.severity())
.setCreatedAt(buffer.now())
.setUpdatedAt(buffer.now())
- .setStatus(ruleDef.status().name());
+ .setStatus(ruleDef.status().name())
+ // TODO set default characteristic id
+ .setDefaultRemediationFunction(remediationFunction != null ? remediationFunction.name() : null)
+ .setDefaultRemediationFactor(ruleDef.remediationFactor())
+ .setDefaultRemediationOffset(ruleDef.remediationOffset())
+ .setEffortToFixL10nKey(ruleDef.effortToFixL10nKey());
ruleDao.insert(ruleDto, sqlSession);
buffer.add(ruleDto);
dto.setConfigKey(def.internalKey());
changed = true;
}
- String severity = RulePriority.valueOf(def.severity()).name();
+ String severity = def.severity();
if (!ObjectUtils.equals(dto.getSeverityString(), severity)) {
dto.setSeverity(severity);
changed = true;
dto.setStatus(status);
changed = true;
}
+
+ // TODO add characteristic id change verification
+
+ RemediationFunction remediationFunction = def.remediationFunction();
+ String remediationFunctionString = remediationFunction != null ? remediationFunction.name() : null;
+ if (!StringUtils.equals(dto.getDefaultRemediationFunction(), remediationFunctionString)) {
+ dto.setDefaultRemediationFunction(remediationFunctionString);
+ changed = true;
+ }
+ if (!StringUtils.equals(dto.getDefaultRemediationFactor(), def.remediationFactor())) {
+ dto.setDefaultRemediationFactor(def.remediationFactor());
+ changed = true;
+ }
+ if (!StringUtils.equals(dto.getDefaultRemediationOffset(), def.remediationOffset())) {
+ dto.setDefaultRemediationOffset(def.remediationOffset());
+ changed = true;
+ }
+ if (!StringUtils.equals(dto.getEffortToFixL10nKey(), def.effortToFixL10nKey())) {
+ dto.setEffortToFixL10nKey(def.effortToFixL10nKey());
+ changed = true;
+ }
+
if (!StringUtils.equals(dto.getLanguage(), def.repository().language())) {
dto.setLanguage(def.repository().language());
changed = true;
// TODO merge params and tags ?
ruleDto.setLanguage(parent.getLanguage());
ruleDto.setStatus(parent.getStatus());
+ ruleDto.setDefaultCharacteristicId(parent.getDefaultCharacteristicId());
+ ruleDto.setDefaultRemediationFunction(parent.getDefaultRemediationFunction());
+ ruleDto.setDefaultRemediationFactor(parent.getDefaultRemediationFactor());
+ ruleDto.setDefaultRemediationOffset(parent.getDefaultRemediationOffset());
+ ruleDto.setEffortToFixL10nKey(parent.getEffortToFixL10nKey());
ruleDto.setUpdatedAt(buffer.now());
ruleDao.update(ruleDto, sqlSession);
toBeRemoved = false;
--- /dev/null
+#
+# SonarQube, open source software quality management tool.
+# Copyright (C) 2008-2013 SonarSource
+# mailto:contact AT sonarsource DOT com
+#
+# SonarQube 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.
+#
+# SonarQube 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.
+#
+
+#
+# Sonar 4.3
+# SONAR-5056
+#
+class AddDebtColumnsToRules < ActiveRecord::Migration
+
+ def self.up
+ add_column 'rules', :characteristic_id, :integer, :null => true
+ add_column 'rules', :default_characteristic_id, :integer, :null => true
+ add_column 'rules', :remediation_function, :string, :null => true, :limit => 20
+ add_column 'rules', :default_remediation_function, :string, :null => true, :limit => 20
+ add_column 'rules', :remediation_factor, :string, :null => true, :limit => 20
+ add_column 'rules', :default_remediation_factor, :string, :null => true, :limit => 20
+ add_column 'rules', :remediation_offset, :string, :null => true, :limit => 20
+ add_column 'rules', :default_remediation_offset, :string, :null => true, :limit => 20
+ add_column 'rules', :effort_to_fix_l10n_key, :string, :null => true, :limit => 100
+ end
+
+end
+
import org.junit.Before;
import org.junit.Test;
+import org.sonar.api.rule.RemediationFunction;
import org.sonar.api.rule.RuleStatus;
import org.sonar.api.rule.Severity;
import org.sonar.api.server.rule.RuleDefinitions;
public class RuleRegistrationTest extends AbstractDaoTestCase {
- private static final String[] EXCLUDED_COLUMN_NAMES = {
- "created_at", "updated_at", "note_data", "note_user_login", "note_created_at", "note_updated_at"};
+ private static final String[] EXCLUDED_COLUMN_NAMES = {"created_at", "updated_at", "note_data", "note_user_login", "note_created_at", "note_updated_at"};
+ private static final String[] EXCLUDED_COLUMN_NAMES_INCLUDING_DEBT = {"created_at", "updated_at", "note_data", "note_user_login", "note_created_at", "note_updated_at",
+ "characteristic_id", "default_characteristic_id",
+ "remediation_function", "default_remediation_function", "remediation_factor", "default_remediation_factor", "remediation_offset", "default_remediation_offset",
+ "effort_to_fix_l10n_key"};
RuleRegistration task;
ProfilesManager profilesManager = mock(ProfilesManager.class);
}
@Test
- public void should_insert_new_rules() {
+ public void insert_new_rules() {
setupData("shared");
task.start();
- checkTables("should_insert_new_rules", EXCLUDED_COLUMN_NAMES, "rules", "rules_parameters", "rules_rule_tags", "rule_tags");
+ checkTables("insert_new_rules", EXCLUDED_COLUMN_NAMES, "rules", "rules_parameters", "rules_rule_tags", "rule_tags");
}
@Test
- public void should_update_template_rule_language() {
- setupData("should_update_template_rule_language");
+ public void update_template_rule_language() {
+ setupData("update_template_rule_language");
task.start();
- checkTables("should_update_template_rule_language", EXCLUDED_COLUMN_NAMES, "rules");
+ checkTables("update_template_rule_language", EXCLUDED_COLUMN_NAMES, "rules");
}
/**
}
@Test
- public void should_reactivate_disabled_rules() {
- setupData("should_reactivate_disabled_rules");
+ public void reactivate_disabled_rules() {
+ setupData("reactivate_disabled_rules");
task.start();
- checkTables("should_reactivate_disabled_rules", EXCLUDED_COLUMN_NAMES, "rules");
+ checkTables("reactivate_disabled_rules", EXCLUDED_COLUMN_NAMES_INCLUDING_DEBT, "rules");
assertThat(ruleDao.selectById(1).getUpdatedAt()).isNotNull();
}
setupData("reactivate_disabled_template_rules");
task.start();
- checkTables("reactivate_disabled_template_rules", EXCLUDED_COLUMN_NAMES, "rules");
+ checkTables("reactivate_disabled_template_rules", EXCLUDED_COLUMN_NAMES_INCLUDING_DEBT, "rules");
}
@Test
- public void should_disable_deprecated_active_rules() {
- setupData("should_disable_deprecated_active_rules");
+ public void disable_deprecated_active_rules() {
+ setupData("disable_deprecated_active_rules");
task.start();
- checkTables("should_disable_deprecated_active_rules", EXCLUDED_COLUMN_NAMES, "rules");
+ checkTables("disable_deprecated_active_rules", EXCLUDED_COLUMN_NAMES_INCLUDING_DEBT, "rules");
}
@Test
- public void should_disable_deprecated_active_rule_params() {
- setupData("should_disable_deprecated_active_rule_params");
+ public void disable_deprecated_active_rule_params() {
+ setupData("disable_deprecated_active_rule_params");
task.start();
- checkTables("should_disable_deprecated_active_rule_params", EXCLUDED_COLUMN_NAMES, "rules", "rules_parameters", "active_rules", "active_rule_parameters");
+ checkTables("disable_deprecated_active_rule_params", EXCLUDED_COLUMN_NAMES_INCLUDING_DEBT, "rules", "rules_parameters", "active_rules", "active_rule_parameters");
}
@Test
- public void should_disable_deprecated_rules() {
- setupData("should_disable_deprecated_rules");
+ public void disable_deprecated_rules() {
+ setupData("disable_deprecated_rules");
task.start();
- checkTables("should_disable_deprecated_rules", EXCLUDED_COLUMN_NAMES, "rules", "rules_parameters", "rules_rule_tags", "rule_tags");
+ checkTables("disable_deprecated_rules", EXCLUDED_COLUMN_NAMES_INCLUDING_DEBT, "rules", "rules_parameters", "rules_rule_tags", "rule_tags");
}
@Test
- public void should_update_rule_fields() {
- setupData("updadeRuleFields");
+ public void update_rule_fields() {
+ setupData("update_rule_fields");
task.start();
- checkTables("updadeRuleFields", EXCLUDED_COLUMN_NAMES, "rules", "rules_parameters", "rule_tags", "rules_rule_tags");
+ checkTables("update_rule_fields", EXCLUDED_COLUMN_NAMES, "rules", "rules_parameters", "rule_tags", "rules_rule_tags");
}
@Test
- public void should_update_rule_parameters() {
- setupData("should_update_rule_parameters");
+ public void update_rule_parameters() {
+ setupData("update_rule_parameters");
task.start();
- checkTables("should_update_rule_parameters", EXCLUDED_COLUMN_NAMES, "rules", "rules_parameters");
+ checkTables("update_rule_parameters", EXCLUDED_COLUMN_NAMES_INCLUDING_DEBT, "rules", "rules_parameters");
}
@Test
- public void should_not_disable_template_rules_if_parent_is_enabled() {
- setupData("doNotDisableUserRulesIfParentIsEnabled");
+ public void not_disable_template_rules_if_parent_is_enabled() {
+ setupData("not_disable_template_rules_if_parent_is_enabled");
task.start();
- checkTables("doNotDisableUserRulesIfParentIsEnabled", EXCLUDED_COLUMN_NAMES, "rules");
+ checkTables("not_disable_template_rules_if_parent_is_enabled", EXCLUDED_COLUMN_NAMES_INCLUDING_DEBT, "rules");
}
@Test
- public void should_disable_template_rules_if_parent_is_disabled() {
- setupData("disableUserRulesIfParentIsDisabled");
+ public void disable_template_rules_if_parent_is_disabled() {
+ setupData("disable_template_rules_if_parent_is_disabled");
task.start();
- checkTables("disableUserRulesIfParentIsDisabled", EXCLUDED_COLUMN_NAMES, "rules");
+ checkTables("disable_template_rules_if_parent_is_disabled", EXCLUDED_COLUMN_NAMES_INCLUDING_DEBT, "rules");
}
@Test
- public void should_not_disable_manual_rules() {
+ public void not_disable_manual_rules() {
// the hardcoded repository "manual" is used for manual violations
- setupData("shouldNotDisableManualRules");
+ setupData("not_disable_manual_rules");
task.start();
- checkTables("shouldNotDisableManualRules", EXCLUDED_COLUMN_NAMES, "rules");
+ checkTables("not_disable_manual_rules", EXCLUDED_COLUMN_NAMES_INCLUDING_DEBT, "rules");
}
@Test
}
@Test
- public void should_insert_extended_repositories() {
+ public void insert_extended_repositories() {
task = new RuleRegistration(new RuleDefinitionsLoader(mock(RuleRepositories.class), new RuleDefinitions[]{
- new FindbugsRepository(), new FbContribRepository()}),
+ new FindbugsRepository(), new FbContribRepository()}),
profilesManager, ruleRegistry, esRuleTags, ruleTagOperations, myBatis, ruleDao, ruleTagDao, activeRuleDao);
setupData("empty");
task.start();
- checkTables("should_insert_extended_repositories", EXCLUDED_COLUMN_NAMES, "rules");
+ checkTables("insert_extended_repositories", EXCLUDED_COLUMN_NAMES_INCLUDING_DEBT, "rules");
}
static class FakeRepository implements RuleDefinitions {
NewRepository repo = context.newRepository("fake", "java");
NewRule rule1 = repo.newRule("rule1")
- .setName("One")
- .setHtmlDescription("Description of One")
- .setSeverity(Severity.BLOCKER)
- .setInternalKey("config1")
- .setTags("tag1", "tag3", "tag5");
+ .setName("One")
+ .setHtmlDescription("Description of One")
+ .setSeverity(Severity.BLOCKER)
+ .setCharacteristicKey("COMPILER")
+ .setRemediationFunction(RemediationFunction.LINEAR_OFFSET)
+ .setRemediationFactor("5d")
+ .setRemediationOffset("10h")
+ .setEffortToFixL10nKey("squid.S115.effortToFix")
+ .setInternalKey("config1")
+ .setTags("tag1", "tag3", "tag5");
rule1.newParam("param1").setDescription("parameter one").setDefaultValue("default value one");
rule1.newParam("param2").setDescription("parameter two").setDefaultValue("default value two");
repo.newRule("rule2")
- .setName("Two")
- .setHtmlDescription("Description of Two")
- .setSeverity(Severity.INFO)
- .setStatus(RuleStatus.DEPRECATED);
+ .setName("Two")
+ .setHtmlDescription("Description of Two")
+ .setSeverity(Severity.INFO)
+ .setStatus(RuleStatus.DEPRECATED);
repo.done();
}
}
NewRepository repo = context.newRepository("big", "java");
for (int i = 0; i < SIZE; i++) {
NewRule rule = repo.newRule("rule" + i)
- .setName("name of " + i)
- .setHtmlDescription("description of " + i)
- .setSeverity(Severity.BLOCKER)
- .setInternalKey("config1")
- .setTags("tag1", "tag3", "tag5");
+ .setName("name of " + i)
+ .setHtmlDescription("description of " + i)
+ .setSeverity(Severity.BLOCKER)
+ .setInternalKey("config1")
+ .setTags("tag1", "tag3", "tag5");
for (int j = 0; j < 20; j++) {
rule.newParam("param" + j);
}
public void define(Context context) {
NewRepository repo = context.newRepository("findbugs", "java");
repo.newRule("rule1")
- .setName("Rule One")
- .setHtmlDescription("Description of Rule One");
+ .setName("Rule One")
+ .setHtmlDescription("Description of Rule One");
repo.done();
}
}
public void define(Context context) {
NewExtendedRepository repo = context.extendRepository("findbugs", "java");
repo.newRule("rule2")
- .setName("Rule Two")
- .setHtmlDescription("Description of Rule Two");
+ .setName("Rule Two")
+ .setHtmlDescription("Description of Rule Two");
repo.done();
}
}
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="disabled_rule" plugin_name="fake" plugin_config_key="[null]" name="Disabled rule" description="[null]"
- status="REMOVED" priority="4" cardinality="MULTIPLE" parent_id="[null]" language="[null]"/>
-
- <rules id="2" plugin_rule_key="user_rule" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
- status="REMOVED" priority="4" cardinality="SINGLE" parent_id="1" language="[null]"/>
-
- <rules id="3" plugin_rule_key="disabled_rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2"
- status="REMOVED" priority="1" cardinality="SINGLE" parent_id="[null]" language="[null]"/>
-
- <rules id="4" plugin_rule_key="template_rule2" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
- status="REMOVED" priority="4" cardinality="SINGLE" parent_id="3" language="[null]"/>
-
- <rules id="5" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
- <rules id="6" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
- status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <!-- Rule as been removed -->
- <rules id="1" plugin_rule_key="disabled_rule" plugin_name="fake" plugin_config_key="[null]" name="Disabled rule" description="[null]"
- status="REMOVED" priority="4" cardinality="MULTIPLE" parent_id="[null]"/>
-
- <!-- user rule duplicated from rule 1. It is currently enabled. -->
- <rules id="2" plugin_rule_key="user_rule" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
- status="READY" priority="4" cardinality="SINGLE" parent_id="1"/>
-
- <!-- This rule will be removed... -->
- <rules id="3" plugin_rule_key="disabled_rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2"
- status="READY" priority="1" cardinality="SINGLE" parent_id="[null]" />
-
- <!-- ...so this template will be removed too -->
- <rules id="4" plugin_rule_key="template_rule2" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
- status="READY" priority="4" cardinality="SINGLE" parent_id="3"/>
-
-</dataset>
\ No newline at end of file
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+ <rules id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
+ status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+ <rules_parameters id="1" rule_id="1" default_value="default value one" description="parameter one" name="param1" param_type="STRING"/>
+ <rules_parameters id="2" rule_id="1" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/>
+
+ <rules_profiles id="1" version="1" used_profile="true" name="profile name" language="java" />
+ <active_rules id="1" rule_id="1" profile_id="1" failure_level="4" inheritance="[null]" />
+ <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" value="one" rules_parameter_key="[null]"/>
+ <active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" value="two" rules_parameter_key="[null]"/>
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description"
+ status="READY" priority="2" cardinality="SINGLE" parent_id="[null]" />
+
+ <rules_parameters id="1" rule_id="1" name="param1" description="[null]" param_type="STRING"/>
+ <rules_parameters id="2" rule_id="1" name="param2" description="[null]" param_type="STRING"/>
+
+ <!-- to be removed -->
+ <rules_parameters id="3" rule_id="1" name="param3" description="[null]" param_type="STRING"/>
+
+
+ <rules_profiles id="1" version="1" used_profile="true" name="profile name" language="java" />
+ <active_rules id="1" rule_id="1" profile_id="1" failure_level="4" />
+ <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" value="one" />
+ <active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" value="two" />
+
+ <!-- to be removed -->
+ <active_rule_parameters id="3" active_rule_id="1" rules_parameter_id="3" value="three" />
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]"
+ status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/>
+
+ <rules id="2" plugin_rule_key="deprecated" plugin_name="fake" plugin_config_key="[null]" name="Deprecated fake" description="[null]"
+ status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/>
+
+ <rules id="3" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+ <rules id="4" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
+ status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/>
+
+ <rules id="2" plugin_rule_key="deprecated" plugin_name="fake" plugin_config_key="[null]" name="Deprecated fake" description="[null]"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/>
+
+ <rules_parameters id="1" rule_id="1" name="deprecated-prop" description="[null]" param_type="STRING"/>
+
+ <rules_profiles id="1" version="1" used_profile="true" name="sonar way" language="java" />
+ <active_rules id="1" rule_id="1" profile_id="1" failure_level="4" />
+ <active_rules id="2" rule_id="2" profile_id="1" failure_level="0" />
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]"
+ status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/>
+
+ <rules id="2" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
+ <rules_parameters id="1" rule_id="2" default_value="default value one" description="parameter one" name="param1" param_type="STRING"/>
+ <rules_parameters id="2" rule_id="2" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/>
+ <rule_tags id="1" rule_id="2" tag="tag1" tag_type="SYSTEM"/>
+ <rule_tags id="2" rule_id="2" tag="tag3" tag_type="SYSTEM"/>
+ <rule_tags id="3" rule_id="2" tag="tag5" tag_type="SYSTEM"/>
+
+ <rules id="3" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="rule2" name="Two" description="Description of Two"
+ status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]"
+ status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/>
+
+ <rules id="2" plugin_rule_key="deprecated" plugin_name="fake" plugin_config_key="[null]" name="Deprecated fake" description="[null]"
+ status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/>
+
+ <rules_parameters id="1" rule_id="1" name="deprecated-prop" description="[null]" param_type="STRING" default_value="[null]"/>
+
+ <rules id="3" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+ <rules_parameters id="2" rule_id="3" default_value="default value one" description="parameter one" name="param1" param_type="STRING"/>
+ <rules_parameters id="3" rule_id="3" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/>
+
+ <rules id="4" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
+ status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+ <rule_tags id="3" tag="tag1"/>
+ <rule_tags id="4" tag="tag3"/>
+ <rule_tags id="5" tag="tag5"/>
+
+ <rules_rule_tags id="3" rule_id="3" rule_tag_id="3" tag_type="SYSTEM"/>
+ <rules_rule_tags id="4" rule_id="3" rule_tag_id="4" tag_type="SYSTEM"/>
+ <rules_rule_tags id="5" rule_id="3" rule_tag_id="5" tag_type="SYSTEM"/>
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/>
+
+ <rules id="2" plugin_rule_key="deprecated" plugin_name="fake" plugin_config_key="[null]" name="Deprecated fake" description="[null]"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/>
+
+ <rules_parameters id="1" rule_id="1" name="deprecated-prop" description="[null]" param_type="STRING"/>
+
+ <rule_tags id="1" tag="formertag1"/>
+ <rule_tags id="2" tag="formertag2"/>
+
+ <rules_rule_tags id="1" rule_id="1" rule_tag_id="1" tag_type="SYSTEM"/>
+ <rules_rule_tags id="2" rule_id="1" rule_tag_id="2" tag_type="ADMIN"/>
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="disabled_rule" plugin_name="fake" plugin_config_key="[null]" name="Disabled rule" description="[null]"
+ status="REMOVED" priority="4" cardinality="MULTIPLE" parent_id="[null]" language="[null]"/>
+
+ <rules id="2" plugin_rule_key="user_rule" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
+ status="REMOVED" priority="4" cardinality="SINGLE" parent_id="1" language="[null]"/>
+
+ <rules id="3" plugin_rule_key="disabled_rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2"
+ status="REMOVED" priority="1" cardinality="SINGLE" parent_id="[null]" language="[null]"/>
+
+ <rules id="4" plugin_rule_key="template_rule2" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
+ status="REMOVED" priority="4" cardinality="SINGLE" parent_id="3" language="[null]"/>
+
+ <rules id="5" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+ <rules id="6" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
+ status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <!-- Rule as been removed -->
+ <rules id="1" plugin_rule_key="disabled_rule" plugin_name="fake" plugin_config_key="[null]" name="Disabled rule" description="[null]"
+ status="REMOVED" priority="4" cardinality="MULTIPLE" parent_id="[null]"/>
+
+ <!-- user rule duplicated from rule 1. It is currently enabled. -->
+ <rules id="2" plugin_rule_key="user_rule" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="1"/>
+
+ <!-- This rule will be removed... -->
+ <rules id="3" plugin_rule_key="disabled_rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2"
+ status="READY" priority="1" cardinality="SINGLE" parent_id="[null]" />
+
+ <!-- ...so this template will be removed too -->
+ <rules id="4" plugin_rule_key="template_rule2" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="3"/>
+
+</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
- <rules id="2" plugin_rule_key="user_rule" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
- status="READY" priority="4" cardinality="SINGLE" parent_id="1" language="java"/>
-
- <rules id="3" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
- status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="[null]" name="Rule one" description="[null]"
- status="READY" priority="4" cardinality="MULTIPLE" parent_id="[null]"/>
-
- <rules id="2" plugin_rule_key="user_rule" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
- status="READY" priority="4" cardinality="SINGLE" parent_id="1"/>
-
-</dataset>
\ No newline at end of file
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="rule1" plugin_name="findbugs" plugin_config_key="[null]" name="Rule One" description="Description of Rule One"
+ status="READY" priority="2" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+ <rules id="2" plugin_rule_key="rule2" plugin_name="findbugs" plugin_config_key="[null]" name="Rule Two" description="Description of Rule Two"
+ status="READY" priority="2" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+</dataset>
--- /dev/null
+<!--
+ ~ SonarQube, open source software quality management tool.
+ ~ Copyright (C) 2008-2013 SonarSource
+ ~ mailto:contact AT sonarsource DOT com
+ ~
+ ~ SonarQube 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.
+ ~
+ ~ SonarQube 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.
+ -->
+
+<dataset>
+
+ <rules id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]"
+ status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"
+ characteristic_id="[null]" default_characteristic_id="[null]"
+ remediation_function="[null]" default_remediation_function="[null]"
+ remediation_factor="[null]" default_remediation_factor="[null]"
+ remediation_offset="[null]" default_remediation_offset="[null]"
+ effort_to_fix_l10n_key="[null]"/>
+
+ <rules id="2" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"
+ characteristic_id="[null]" default_characteristic_id="[null]"
+ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET"
+ remediation_factor="[null]" default_remediation_factor="5d"
+ remediation_offset="[null]" default_remediation_offset="10h"
+ effort_to_fix_l10n_key="squid.S115.effortToFix"/>
+
+ <rules_parameters id="1" rule_id="2" default_value="default value one" description="parameter one" name="param1" param_type="STRING"/>
+ <rules_parameters id="2" rule_id="2" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/>
+
+ <rule_tags id="1" tag="tag1"/>
+ <rule_tags id="2" tag="tag3"/>
+ <rule_tags id="3" tag="tag5"/>
+
+ <rules_rule_tags id="1" rule_id="2" rule_tag_id="1" tag_type="SYSTEM"/>
+ <rules_rule_tags id="2" rule_id="2" rule_tag_id="2" tag_type="SYSTEM"/>
+ <rules_rule_tags id="3" rule_id="2" rule_tag_id="3" tag_type="SYSTEM"/>
+
+ <rules id="3" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
+ status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"
+ characteristic_id="[null]" default_characteristic_id="[null]"
+ remediation_function="[null]" default_remediation_function="[null]"
+ remediation_factor="[null]" default_remediation_factor="[null]"
+ remediation_offset="[null]" default_remediation_offset="[null]"
+ effort_to_fix_l10n_key="[null]"/>
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="PerformanceIssue" plugin_name="manual" plugin_config_key="[null]" name="Performance Issue" description="[null]"
+ status="READY" priority="[null]" cardinality="SINGLE" parent_id="[null]" language="[null]"/>
+
+ <rules id="2" plugin_rule_key="IllegalExceptionCheck" plugin_name="checkstyle" plugin_config_key="[null]" name="Illegal Exception" description="[null]"
+ status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/>
+
+ <rules id="3" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+ <rules id="4" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
+ status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="PerformanceIssue" plugin_name="manual" plugin_config_key="[null]" name="Performance Issue" description="[null]"
+ status="READY" priority="[null]" cardinality="SINGLE" parent_id="[null]"/>
+
+ <rules id="2" plugin_rule_key="IllegalExceptionCheck" plugin_name="checkstyle" plugin_config_key="[null]" name="Illegal Exception" description="[null]"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/>
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+ <rules id="2" plugin_rule_key="user_rule" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="1" language="java"/>
+
+ <rules id="3" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
+ status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="[null]" name="Rule one" description="[null]"
+ status="READY" priority="4" cardinality="MULTIPLE" parent_id="[null]"/>
+
+ <rules id="2" plugin_rule_key="user_rule" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="1"/>
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]"
+ status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+ <rules id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="rule2" name="Two" description="Description of Two"
+ status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]"
+ status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]"/>
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+ <rules id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
+ status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="[null]" name="Old name" description="Old description"
+ status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]"/>
+
+</dataset>
<rules id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]"
status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/>
-</dataset>
\ No newline at end of file
+</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="PerformanceIssue" plugin_name="manual" plugin_config_key="[null]" name="Performance Issue" description="[null]"
- status="READY" priority="[null]" cardinality="SINGLE" parent_id="[null]" language="[null]"/>
-
- <rules id="2" plugin_rule_key="IllegalExceptionCheck" plugin_name="checkstyle" plugin_config_key="[null]" name="Illegal Exception" description="[null]"
- status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/>
-
- <rules id="3" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
- <rules id="4" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
- status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="PerformanceIssue" plugin_name="manual" plugin_config_key="[null]" name="Performance Issue" description="[null]"
- status="READY" priority="[null]" cardinality="SINGLE" parent_id="[null]"/>
-
- <rules id="2" plugin_rule_key="IllegalExceptionCheck" plugin_name="checkstyle" plugin_config_key="[null]" name="Illegal Exception" description="[null]"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/>
-
-</dataset>
\ No newline at end of file
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
- <rules id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
- status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
- <rules_parameters id="1" rule_id="1" default_value="default value one" description="parameter one" name="param1" param_type="STRING"/>
- <rules_parameters id="2" rule_id="1" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/>
-
- <rules_profiles id="1" version="1" used_profile="true" name="profile name" language="java" />
- <active_rules id="1" rule_id="1" profile_id="1" failure_level="4" inheritance="[null]" />
- <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" value="one" rules_parameter_key="[null]"/>
- <active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" value="two" rules_parameter_key="[null]"/>
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description"
- status="READY" priority="2" cardinality="SINGLE" parent_id="[null]" />
-
- <rules_parameters id="1" rule_id="1" name="param1" description="[null]" param_type="STRING"/>
- <rules_parameters id="2" rule_id="1" name="param2" description="[null]" param_type="STRING"/>
-
- <!-- to be removed -->
- <rules_parameters id="3" rule_id="1" name="param3" description="[null]" param_type="STRING"/>
-
-
- <rules_profiles id="1" version="1" used_profile="true" name="profile name" language="java" />
- <active_rules id="1" rule_id="1" profile_id="1" failure_level="4" />
- <active_rule_parameters id="1" active_rule_id="1" rules_parameter_id="1" value="one" />
- <active_rule_parameters id="2" active_rule_id="1" rules_parameter_id="2" value="two" />
-
- <!-- to be removed -->
- <active_rule_parameters id="3" active_rule_id="1" rules_parameter_id="3" value="three" />
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]"
- status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/>
-
- <rules id="2" plugin_rule_key="deprecated" plugin_name="fake" plugin_config_key="[null]" name="Deprecated fake" description="[null]"
- status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/>
-
- <rules id="3" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
- <rules id="4" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
- status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/>
-
- <rules id="2" plugin_rule_key="deprecated" plugin_name="fake" plugin_config_key="[null]" name="Deprecated fake" description="[null]"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/>
-
- <rules_parameters id="1" rule_id="1" name="deprecated-prop" description="[null]" param_type="STRING"/>
-
- <rules_profiles id="1" version="1" used_profile="true" name="sonar way" language="java" />
- <active_rules id="1" rule_id="1" profile_id="1" failure_level="4" />
- <active_rules id="2" rule_id="2" profile_id="1" failure_level="0" />
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]"
- status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/>
-
- <rules id="2" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
- <rules_parameters id="1" rule_id="2" default_value="default value one" description="parameter one" name="param1" param_type="STRING"/>
- <rules_parameters id="2" rule_id="2" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/>
- <rule_tags id="1" rule_id="2" tag="tag1" tag_type="SYSTEM"/>
- <rule_tags id="2" rule_id="2" tag="tag3" tag_type="SYSTEM"/>
- <rule_tags id="3" rule_id="2" tag="tag5" tag_type="SYSTEM"/>
-
- <rules id="3" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="rule2" name="Two" description="Description of Two"
- status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]"
- status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/>
-
- <rules id="2" plugin_rule_key="deprecated" plugin_name="fake" plugin_config_key="[null]" name="Deprecated fake" description="[null]"
- status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/>
-
- <rules_parameters id="1" rule_id="1" name="deprecated-prop" description="[null]" param_type="STRING" default_value="[null]"/>
-
- <rules id="3" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
- <rules_parameters id="2" rule_id="3" default_value="default value one" description="parameter one" name="param1" param_type="STRING"/>
- <rules_parameters id="3" rule_id="3" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/>
-
- <rules id="4" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
- status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
- <rule_tags id="3" tag="tag1"/>
- <rule_tags id="4" tag="tag3"/>
- <rule_tags id="5" tag="tag5"/>
-
- <rules_rule_tags id="3" rule_id="3" rule_tag_id="3" tag_type="SYSTEM"/>
- <rules_rule_tags id="4" rule_id="3" rule_tag_id="4" tag_type="SYSTEM"/>
- <rules_rule_tags id="5" rule_id="3" rule_tag_id="5" tag_type="SYSTEM"/>
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/>
-
- <rules id="2" plugin_rule_key="deprecated" plugin_name="fake" plugin_config_key="[null]" name="Deprecated fake" description="[null]"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]"/>
-
- <rules_parameters id="1" rule_id="1" name="deprecated-prop" description="[null]" param_type="STRING"/>
-
- <rule_tags id="1" tag="formertag1"/>
- <rule_tags id="2" tag="formertag2"/>
-
- <rules_rule_tags id="1" rule_id="1" rule_tag_id="1" tag_type="SYSTEM"/>
- <rules_rule_tags id="2" rule_id="1" rule_tag_id="2" tag_type="ADMIN"/>
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="rule1" plugin_name="findbugs" plugin_config_key="[null]" name="Rule One" description="Description of Rule One"
- status="READY" priority="2" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
- <rules id="2" plugin_rule_key="rule2" plugin_name="findbugs" plugin_config_key="[null]" name="Rule Two" description="Description of Rule Two"
- status="READY" priority="2" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
-</dataset>
\ No newline at end of file
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]"
- status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="[null]"/>
-
- <rules id="2" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
- <rules_parameters id="1" rule_id="2" default_value="default value one" description="parameter one" name="param1" param_type="STRING"/>
- <rules_parameters id="2" rule_id="2" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/>
-
- <rule_tags id="1" tag="tag1"/>
- <rule_tags id="2" tag="tag3"/>
- <rule_tags id="3" tag="tag5"/>
-
- <rules_rule_tags id="1" rule_id="2" rule_tag_id="1" tag_type="SYSTEM"/>
- <rules_rule_tags id="2" rule_id="2" rule_tag_id="2" tag_type="SYSTEM"/>
- <rules_rule_tags id="3" rule_id="2" rule_tag_id="3" tag_type="SYSTEM"/>
-
- <rules id="3" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
- status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
-</dataset>
\ No newline at end of file
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]"
- status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
- <rules id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="rule2" name="Two" description="Description of Two"
- status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="deprecated-key" plugin_name="deprecated-repo" plugin_config_key="[null]" name="Deprecated" description="[null]"
- status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]"/>
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
- <rules id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
- status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="[null]" name="Old name" description="Old description"
- status="REMOVED" priority="4" cardinality="SINGLE" parent_id="[null]"/>
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="The One" description="The Description of One"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
- <rules id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="rule2" name="Two" description="Description of Two"
- status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
- <rules_parameters id="1" rule_id="1" default_value="default value one" description="parameter one" name="param1" param_type="STRING"/>
- <rules_parameters id="3" rule_id="1" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/>
-
- <rules id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
- status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description"
- status="READY" priority="2" cardinality="SINGLE" parent_id="[null]"/>
-
- <rules id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2"
- status="READY" priority="1" cardinality="SINGLE" parent_id="[null]"/>
-
- <rules_parameters id="1" rule_id="1" name="param1" description="old description" param_type="STRING"/>
- <rules_parameters id="2" rule_id="1" name="deprecated_param" description="deprecated param to be removed" param_type="STRING"/>
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
- <!-- Instance of old rule 1 :/ -->
- <rules id="2" plugin_rule_key="template_rule1" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
- status="READY" priority="4" cardinality="SINGLE" parent_id="1" language="java"/>
-
- <rules id="3" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
- status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
- <!-- Template of old rule 3 :/ -->
- <rules id="4" plugin_rule_key="template_rule2" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
- status="DEPRECATED" priority="4" cardinality="SINGLE" parent_id="3" language="java"/>
-
-</dataset>
\ No newline at end of file
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="[null]" name="Rule one" description="[null]"
- status="READY" priority="4" cardinality="MULTIPLE" parent_id="[null]" language="[null]"/>
-
- <!-- Instance of rule 1 -->
- <rules id="2" plugin_rule_key="template_rule1" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
- status="READY" priority="4" cardinality="SINGLE" parent_id="1" language="[null]"/>
-
- <rules id="3" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2"
- status="DEPRECATED" priority="1" cardinality="MULTIPLE" parent_id="[null]" />
-
- <!-- Instance of rule 3 -->
- <rules id="4" plugin_rule_key="template_rule2" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
- status="READY" priority="4" cardinality="SINGLE" parent_id="3"/>
-
-</dataset>
\ No newline at end of file
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="The One" description="The Description of One"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+ <rules id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="rule2" name="Two" description="Description of Two"
+ status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
- status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
- <rules_parameters id="1" rule_id="1" default_value="default value one" description="parameter one" name="param1" param_type="STRING"/>
- <rules_parameters id="2" rule_id="1" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/>
-
- <rule_tags id="1" tag="tag1"/>
- <rule_tags id="3" tag="tag3"/>
- <rule_tags id="4" tag="tag4"/>
- <rule_tags id="5" tag="tag5"/>
-
- <rules_rule_tags id="1" rule_id="1" rule_tag_id="1" tag_type="SYSTEM"/>
- <rules_rule_tags id="3" rule_id="1" rule_tag_id="3" tag_type="SYSTEM"/>
- <rules_rule_tags id="4" rule_id="1" rule_tag_id="4" tag_type="ADMIN"/>
- <rules_rule_tags id="5" rule_id="1" rule_tag_id="5" tag_type="SYSTEM"/>
-
- <rules id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
- status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
-
-</dataset>
+++ /dev/null
-<dataset>
-
- <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description"
- status="READY" priority="2" cardinality="SINGLE" parent_id="[null]" />
-
- <rules_parameters id="1" rule_id="1" name="param1" description="[null]" param_type="STRING"/>
-
- <rule_tags id="1" tag="tag1"/>
- <rule_tags id="2" tag="tag2"/>
- <rule_tags id="3" tag="tag3"/>
- <rule_tags id="4" tag="tag4"/>
-
- <rules_rule_tags id="1" rule_id="1" rule_tag_id="1" tag_type="SYSTEM"/>
- <rules_rule_tags id="2" rule_id="1" rule_tag_id="2" tag_type="SYSTEM"/>
- <rules_rule_tags id="3" rule_id="1" rule_tag_id="3" tag_type="ADMIN"/>
- <rules_rule_tags id="4" rule_id="1" rule_tag_id="4" tag_type="ADMIN"/>
-
- <rules id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2"
- status="READY" priority="1" cardinality="SINGLE" parent_id="[null]" />
-
-
-</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"
+ characteristic_id="[null]" default_characteristic_id="200"
+ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET"
+ remediation_factor="[null]" default_remediation_factor="5d"
+ remediation_offset="[null]" default_remediation_offset="10h"
+ effort_to_fix_l10n_key="squid.S115.effortToFix"/>
+
+ <rules_parameters id="1" rule_id="1" default_value="default value one" description="parameter one" name="param1" param_type="STRING"/>
+ <rules_parameters id="2" rule_id="1" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/>
+
+ <rule_tags id="1" tag="tag1"/>
+ <rule_tags id="3" tag="tag3"/>
+ <rule_tags id="4" tag="tag4"/>
+ <rule_tags id="5" tag="tag5"/>
+
+ <rules_rule_tags id="1" rule_id="1" rule_tag_id="1" tag_type="SYSTEM"/>
+ <rules_rule_tags id="3" rule_id="1" rule_tag_id="3" tag_type="SYSTEM"/>
+ <rules_rule_tags id="4" rule_id="1" rule_tag_id="4" tag_type="ADMIN"/>
+ <rules_rule_tags id="5" rule_id="1" rule_tag_id="5" tag_type="SYSTEM"/>
+
+ <rules id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
+ status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"
+ characteristic_id="[null]" default_characteristic_id="[null]"
+ remediation_function="[null]" default_remediation_function="[null]"
+ remediation_factor="[null]" default_remediation_factor="[null]"
+ remediation_offset="[null]" default_remediation_offset="[null]"
+ effort_to_fix_l10n_key="[null]"/>
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description"
+ status="READY" priority="2" cardinality="SINGLE" parent_id="[null]"
+ characteristic_id="[null]" default_characteristic_id="200"
+ remediation_function="[null]" default_remediation_function="LINEAR"
+ remediation_factor="[null]" default_remediation_factor="14min"
+ remediation_offset="[null]" default_remediation_offset="[null]"
+ effort_to_fix_l10n_key="[null]"/>
+
+ <rules_parameters id="1" rule_id="1" name="param1" description="[null]" param_type="STRING"/>
+
+ <rule_tags id="1" tag="tag1"/>
+ <rule_tags id="2" tag="tag2"/>
+ <rule_tags id="3" tag="tag3"/>
+ <rule_tags id="4" tag="tag4"/>
+
+ <rules_rule_tags id="1" rule_id="1" rule_tag_id="1" tag_type="SYSTEM"/>
+ <rules_rule_tags id="2" rule_id="1" rule_tag_id="2" tag_type="SYSTEM"/>
+ <rules_rule_tags id="3" rule_id="1" rule_tag_id="3" tag_type="ADMIN"/>
+ <rules_rule_tags id="4" rule_id="1" rule_tag_id="4" tag_type="ADMIN"/>
+
+ <rules id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2"
+ status="READY" priority="1" cardinality="SINGLE" parent_id="[null]"/>
+
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"/>
+ <rules_parameters id="1" rule_id="1" default_value="default value one" description="parameter one" name="param1" param_type="STRING"/>
+ <rules_parameters id="3" rule_id="1" default_value="default value two" description="parameter two" name="param2" param_type="STRING"/>
+
+ <rules id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
+ status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"/>
+
+</dataset>
--- /dev/null
+<dataset>
+
+ <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="old_config_key" name="old name" description="old description"
+ status="READY" priority="2" cardinality="SINGLE" parent_id="[null]"/>
+
+ <rules id="2" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2"
+ status="READY" priority="1" cardinality="SINGLE" parent_id="[null]"/>
+
+ <rules_parameters id="1" rule_id="1" name="param1" description="old description" param_type="STRING"/>
+ <rules_parameters id="2" rule_id="1" name="deprecated_param" description="deprecated param to be removed" param_type="STRING"/>
+
+</dataset>
--- /dev/null
+<!--
+ ~ SonarQube, open source software quality management tool.
+ ~ Copyright (C) 2008-2013 SonarSource
+ ~ mailto:contact AT sonarsource DOT com
+ ~
+ ~ SonarQube 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.
+ ~
+ ~ SonarQube 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.
+ -->
+
+<dataset>
+
+ <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="config1" name="One" description="Description of One"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java"
+ characteristic_id="[null]" default_characteristic_id="100"
+ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET"
+ remediation_factor="[null]" default_remediation_factor="5d"
+ remediation_offset="[null]" default_remediation_offset="10h"
+ effort_to_fix_l10n_key="squid.S115.effortToFix" />
+
+ <!-- Instance of old rule 1 :/ -->
+ <rules id="2" plugin_rule_key="template_rule1" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="1" language="java"
+ characteristic_id="[null]" default_characteristic_id="100"
+ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET"
+ remediation_factor="[null]" default_remediation_factor="5d"
+ remediation_offset="[null]" default_remediation_offset="10h"
+ effort_to_fix_l10n_key="squid.S115.effortToFix" />
+
+ <rules id="3" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="[null]" name="Two" description="Description of Two"
+ status="DEPRECATED" priority="0" cardinality="SINGLE" parent_id="[null]" language="java"
+ characteristic_id="[null]" default_characteristic_id="[null]"
+ remediation_function="[null]" default_remediation_function="[null]"
+ remediation_factor="[null]" default_remediation_factor="[null]"
+ remediation_offset="[null]" default_remediation_offset="[null]"
+ effort_to_fix_l10n_key="[null]" />
+
+ <!-- Template of old rule 3 :/ -->
+ <rules id="4" plugin_rule_key="template_rule2" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
+ status="DEPRECATED" priority="4" cardinality="SINGLE" parent_id="3" language="java"
+ characteristic_id="[null]" default_characteristic_id="[null]"
+ remediation_function="[null]" default_remediation_function="[null]"
+ remediation_factor="[null]" default_remediation_factor="[null]"
+ remediation_offset="[null]" default_remediation_offset="[null]"
+ effort_to_fix_l10n_key="[null]" />
+
+</dataset>
--- /dev/null
+<!--
+ ~ SonarQube, open source software quality management tool.
+ ~ Copyright (C) 2008-2013 SonarSource
+ ~ mailto:contact AT sonarsource DOT com
+ ~
+ ~ SonarQube 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.
+ ~
+ ~ SonarQube 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.
+ -->
+
+<dataset>
+
+ <rules id="1" plugin_rule_key="rule1" plugin_name="fake" plugin_config_key="[null]" name="Rule one" description="[null]"
+ status="READY" priority="4" cardinality="MULTIPLE" parent_id="[null]" language="[null]"
+ characteristic_id="[null]" default_characteristic_id="100"
+ remediation_function="[null]" default_remediation_function="LINEAR_OFFSET"
+ remediation_factor="[null]" default_remediation_factor="5d"
+ remediation_offset="[null]" default_remediation_offset="10h"
+ effort_to_fix_l10n_key="squid.S115.effortToFix" />
+
+ <!-- Instance of rule 1 -->
+ <rules id="2" plugin_rule_key="template_rule1" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="1" language="[null]"
+ characteristic_id="[null]" default_characteristic_id="200"
+ remediation_function="[null]" default_remediation_function="LINEAR"
+ remediation_factor="[null]" default_remediation_factor="1h"
+ remediation_offset="[null]" default_remediation_offset="15min"
+ effort_to_fix_l10n_key="squid.S115.effortToFix2" />
+
+ <rules id="3" plugin_rule_key="rule2" plugin_name="fake" plugin_config_key="old_config_key2" name="old name2" description="old description2"
+ status="DEPRECATED" priority="1" cardinality="MULTIPLE" parent_id="[null]"
+ characteristic_id="[null]" default_characteristic_id="[null]"
+ remediation_function="[null]" default_remediation_function="[null]"
+ remediation_factor="[null]" default_remediation_factor="[null]"
+ remediation_offset="[null]" default_remediation_offset="[null]"
+ effort_to_fix_l10n_key="[null]" />
+
+ <!-- Instance of rule 3 -->
+ <rules id="4" plugin_rule_key="template_rule2" plugin_name="fake" plugin_config_key="[null]" name="User rule" description="[null]"
+ status="READY" priority="4" cardinality="SINGLE" parent_id="3"
+ characteristic_id="[null]" default_characteristic_id="[null]"
+ remediation_function="[null]" default_remediation_function="[null]"
+ remediation_factor="[null]" default_remediation_factor="[null]"
+ remediation_offset="[null]" default_remediation_offset="[null]"
+ effort_to_fix_l10n_key="[null]" />
+
+</dataset>