diff options
40 files changed, 130 insertions, 79 deletions
diff --git a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_default_and_overridden_debt_definitions.xml b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_default_and_overridden_debt_definitions.xml index 37c78b19485..177d376274d 100644 --- a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_default_and_overridden_debt_definitions.xml +++ b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_default_and_overridden_debt_definitions.xml @@ -3,7 +3,7 @@ <rules id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" status="READY" priority="1" characteristic_id="103" default_characteristic_id="101" remediation_function="LINEAR" default_remediation_function="LINEAR_OFFSET" - remediation_factor="2h" default_remediation_factor="5d" + remediation_coeff="2h" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h"/> </dataset> diff --git a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_default_characteristic_and_disable_characteristic.xml b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_default_characteristic_and_disable_characteristic.xml index 695d1dfcb4e..8ae55a45cc2 100644 --- a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_default_characteristic_and_disable_characteristic.xml +++ b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_default_characteristic_and_disable_characteristic.xml @@ -3,7 +3,7 @@ <rules id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" status="READY" priority="1" characteristic_id="-1" default_characteristic_id="103" remediation_function="[null]" default_remediation_function="LINEAR" - remediation_factor="[null]" default_remediation_factor="2h" + remediation_coeff="[null]" default_remediation_coeff="2h" remediation_offset="[null]" default_remediation_offset="[null]"/> </dataset> diff --git a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_default_characteristic_and_overridden_function.xml b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_default_characteristic_and_overridden_function.xml index dd8de81aaf7..7ad3ec81ff4 100644 --- a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_default_characteristic_and_overridden_function.xml +++ b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_default_characteristic_and_overridden_function.xml @@ -3,7 +3,7 @@ <rules id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" status="READY" priority="1" characteristic_id="[null]" default_characteristic_id="103" remediation_function="LINEAR" default_remediation_function="[null]" - remediation_factor="2h" default_remediation_factor="[null]" + remediation_coeff="2h" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]"/> </dataset> diff --git a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_default_debt_definitions.xml b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_default_debt_definitions.xml index 0f70de08f9c..19f27fb7910 100644 --- a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_default_debt_definitions.xml +++ b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_default_debt_definitions.xml @@ -23,7 +23,7 @@ <rules id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" status="READY" priority="1" characteristic_id="[null]" default_characteristic_id="101" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" - remediation_factor="[null]" default_remediation_factor="5d" + remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h"/> </dataset> diff --git a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_disable_characteristic.xml b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_disable_characteristic.xml index eb181a7080b..b874787f82c 100644 --- a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_disable_characteristic.xml +++ b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_disable_characteristic.xml @@ -3,7 +3,7 @@ <rules id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" status="READY" priority="1" characteristic_id="-1" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" - remediation_factor="[null]" default_remediation_factor="[null]" + remediation_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]"/> </dataset> diff --git a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_overridden_characteristic_and_default_function.xml b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_overridden_characteristic_and_default_function.xml index ebf9a304157..18e42626eb5 100644 --- a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_overridden_characteristic_and_default_function.xml +++ b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_overridden_characteristic_and_default_function.xml @@ -3,7 +3,7 @@ <rules id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" status="READY" priority="1" characteristic_id="103" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="LINEAR" - remediation_factor="[null]" default_remediation_factor="2h" + remediation_coeff="[null]" default_remediation_coeff="2h" remediation_offset="[null]" default_remediation_offset="[null]"/> </dataset> diff --git a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_overridden_debt_definitions.xml b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_overridden_debt_definitions.xml index 81371488257..9207e1dd492 100644 --- a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_overridden_debt_definitions.xml +++ b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/build_rules_with_overridden_debt_definitions.xml @@ -23,7 +23,7 @@ <rules id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" status="READY" priority="1" characteristic_id="103" default_characteristic_id="[null]" remediation_function="LINEAR" default_remediation_function="[null]" - remediation_factor="2h" default_remediation_factor="[null]" + remediation_coeff="2h" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]"/> </dataset> diff --git a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/fail_if_characteristic_not_found.xml b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/fail_if_characteristic_not_found.xml index 5f8844a11af..1fe98c77cd3 100644 --- a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/fail_if_characteristic_not_found.xml +++ b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/fail_if_characteristic_not_found.xml @@ -23,7 +23,7 @@ <rules id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" status="READY" priority="1" characteristic_id="[null]" default_characteristic_id="999" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" - remediation_factor="[null]" default_remediation_factor="5d" + remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h"/> </dataset> diff --git a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/fail_if_no_function.xml b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/fail_if_no_function.xml index 46a2fc7cfb1..59edbad53bd 100644 --- a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/fail_if_no_function.xml +++ b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/fail_if_no_function.xml @@ -23,7 +23,7 @@ <rules id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" status="READY" priority="1" characteristic_id="[null]" default_characteristic_id="101" remediation_function="[null]" default_remediation_function="[null]" - remediation_factor="[null]" default_remediation_factor="5d" + remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h"/> </dataset> diff --git a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/shared.xml b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/shared.xml index 7d757a6f843..b1f414976eb 100644 --- a/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/shared.xml +++ b/sonar-batch/src/test/resources/org/sonar/batch/rule/RulesProviderTest/shared.xml @@ -23,7 +23,7 @@ <rules id="1" plugin_rule_key="AvoidNull" plugin_name="checkstyle" name="Avoid Null" description="Should avoid NULL" status="READY" priority="1" characteristic_id="[null]" default_characteristic_id="101" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" - remediation_factor="[null]" default_remediation_factor="5d" + remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h"/> <rules_parameters id="1" rule_id="1" name="myParameter" param_type="plop" default_value="plouf" description="My Parameter"/> diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java index 7d920dacaf2..6af72131229 100644 --- a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java +++ b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java @@ -33,7 +33,7 @@ import java.util.List; */ public class DatabaseVersion implements BatchComponent, ServerComponent { - public static final int LAST_VERSION = 522; + public static final int LAST_VERSION = 523; public static enum Status { UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql index b924803a886..66880b5398d 100644 --- a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql +++ b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql @@ -221,6 +221,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('519'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('520'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('521'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('522'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('523'); 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; diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl index 1e87ced7ec7..df9ba235350 100644 --- a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl +++ b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl @@ -159,8 +159,8 @@ CREATE TABLE "RULES" ( "DEFAULT_CHARACTERISTIC_ID" INTEGER, "REMEDIATION_FUNCTION" VARCHAR(20), "DEFAULT_REMEDIATION_FUNCTION" VARCHAR(20), - "REMEDIATION_FACTOR" VARCHAR(20), - "DEFAULT_REMEDIATION_FACTOR" VARCHAR(20), + "REMEDIATION_COEFF" VARCHAR(20), + "DEFAULT_REMEDIATION_COEFF" VARCHAR(20), "REMEDIATION_OFFSET" VARCHAR(20), "DEFAULT_REMEDIATION_OFFSET" VARCHAR(20), "EFFORT_TO_FIX_DESCRIPTION" VARCHAR(4000), diff --git a/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml b/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml index 1b5f75a1542..f6e69e2ca11 100644 --- a/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml +++ b/sonar-core/src/main/resources/org/sonar/core/rule/RuleMapper.xml @@ -23,8 +23,8 @@ r.default_characteristic_id as "defaultSubCharacteristicId", r.remediation_function as "remediationFunction", r.default_remediation_function as "defaultRemediationFunction", - r.remediation_factor as "remediationCoefficient", - r.default_remediation_factor as "defaultRemediationCoefficient", + r.remediation_coeff as "remediationCoefficient", + r.default_remediation_coeff as "defaultRemediationCoefficient", r.remediation_offset as "remediationOffset", r.default_remediation_offset as "defaultRemediationOffset", r.effort_to_fix_description as "effortToFixDescription", @@ -84,8 +84,8 @@ default_characteristic_id=#{defaultSubCharacteristicId}, remediation_function=#{remediationFunction}, default_remediation_function=#{defaultRemediationFunction}, - remediation_factor=#{remediationCoefficient}, - default_remediation_factor=#{defaultRemediationCoefficient}, + remediation_coeff=#{remediationCoefficient}, + default_remediation_coeff=#{defaultRemediationCoefficient}, remediation_offset=#{remediationOffset}, default_remediation_offset=#{defaultRemediationOffset}, effort_to_fix_description=#{effortToFixDescription}, @@ -96,7 +96,7 @@ <sql id="insertColumns"> (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, + remediation_coeff, default_remediation_coeff, remediation_offset, default_remediation_offset, effort_to_fix_description, created_at, updated_at) </sql> diff --git a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/insert-result.xml b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/insert-result.xml index ff959688dc4..e7e1d53d554 100644 --- a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/insert-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/insert-result.xml @@ -25,7 +25,7 @@ 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_coeff="1h" default_remediation_coeff="5d" remediation_offset="5min" default_remediation_offset="10h" effort_to_fix_description="squid.S115.effortToFix" /> diff --git a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/insert_all-result.xml b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/insert_all-result.xml index dce46d3845d..878e3d586ed 100644 --- a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/insert_all-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/insert_all-result.xml @@ -25,7 +25,7 @@ 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_coeff="1h" default_remediation_coeff="5d" remediation_offset="5min" default_remediation_offset="10h" effort_to_fix_description="squid.S115.effortToFix" /> @@ -35,7 +35,7 @@ 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_coeff="5d" default_remediation_coeff="1h" remediation_offset="10h" default_remediation_offset="5min" effort_to_fix_description="squid.S115.effortToFix2" /> diff --git a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/selectAll.xml b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/selectAll.xml index 1511b2e67f9..04f7a7fb3da 100644 --- a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/selectAll.xml +++ b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/selectAll.xml @@ -5,7 +5,7 @@ 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_coeff="1h" default_remediation_coeff="5d" remediation_offset="5min" default_remediation_offset="10h" effort_to_fix_description="squid.S115.effortToFix" /> diff --git a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/select_by_sub_characteristic_id.xml b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/select_by_sub_characteristic_id.xml index b712b6ec0b1..a6677ee6b63 100644 --- a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/select_by_sub_characteristic_id.xml +++ b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/select_by_sub_characteristic_id.xml @@ -27,35 +27,35 @@ <rules id="1" plugin_rule_key="UselessImportCheck" plugin_name="squid" name="UselessImportCheck" description="Useless imports should be removed" status="READY" characteristic_id="2" default_characteristic_id="50" remediation_function="LINEAR_OFFSET" default_remediation_function="LINEAR_OFFSET" - remediation_factor="5d" default_remediation_factor="5d" + remediation_coeff="5d" default_remediation_coeff="5d" remediation_offset="10h" default_remediation_offset="10h" updated_at="2014-02-19"/> <!-- Rule linked to a sub characteristic --> <rules id="2" plugin_rule_key="LeftCurlyBraceStartLineCheck" plugin_name="squid" name="LeftCurlyBraceStartLineCheck" description="Left curly braces should be located at the beginning of lines of code" status="READY" characteristic_id="3" default_characteristic_id="50" remediation_function="LINEAR_OFFSET" default_remediation_function="LINEAR_OFFSET" - remediation_factor="5d" default_remediation_factor="5d" + remediation_coeff="5d" default_remediation_coeff="5d" remediation_offset="10h" default_remediation_offset="10h" updated_at="2014-02-19"/> <!-- Rule linked to a disabled sub characteristic -> should never be returned --> <rules id="3" plugin_rule_key="CallToFileDeleteOnExitMethod" plugin_name="squid" name="CallToFileDeleteOnExitMethod" description="CallToFileDeleteOnExitMethod" status="READY" characteristic_id="11" default_characteristic_id="50" remediation_function="LINEAR" default_remediation_function="LINEAR_OFFSET" - remediation_factor="5d" default_remediation_factor="5d" + remediation_coeff="5d" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19"/> <!-- Removed rule linked to one enable sub characteristic --> <rules id="4" plugin_rule_key="ObjectFinalizeOverridenCallsSuperFinalizeCheck" plugin_name="squid" name="ObjectFinalizeOverridenCallsSuperFinalizeCheck" description="super.finalize() should be called at the end of Object.finalize() implementations" status="REMOVED" characteristic_id="3" default_characteristic_id="50" remediation_function="LINEAR" default_remediation_function="LINEAR_OFFSET" - remediation_factor="5d" default_remediation_factor="5min" + remediation_coeff="5d" default_remediation_coeff="5min" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19"/> <!-- Rule linked to a sub characteristic, but only default characteristic is linked --> <rules id="5" plugin_rule_key="RightCurlyBraceStartLineCheck" plugin_name="squid" name="RightCurlyBraceStartLineCheck" description="Right curly braces should be located at the beginning of lines of code" status="READY" characteristic_id="[null]" default_characteristic_id="3" remediation_function="[null]" default_remediation_function="LINEAR" - remediation_factor="[null]" default_remediation_factor="5d" + remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-02-19"/> </dataset> diff --git a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/select_enables_and_non_manual.xml b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/select_enables_and_non_manual.xml index 971e58bead8..b29914ea915 100644 --- a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/select_enables_and_non_manual.xml +++ b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/select_enables_and_non_manual.xml @@ -4,7 +4,7 @@ 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_coeff="1h" default_remediation_coeff="5d" remediation_offset="5min" default_remediation_offset="10h" effort_to_fix_description="squid.S115.effortToFix"/> @@ -12,7 +12,7 @@ note_data="[null]" note_user_login="[null]" note_created_at="[null]" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" - remediation_factor="[null]" default_remediation_factor="[null]" + remediation_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]"/> @@ -20,7 +20,7 @@ note_data="[null]" note_user_login="[null]" note_created_at="[null]" characteristic_id="[null]" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" - remediation_factor="[null]" default_remediation_factor="[null]" + remediation_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]"/> diff --git a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/update-result.xml b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/update-result.xml index d54cff88519..5c2ad7484e4 100644 --- a/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/update-result.xml +++ b/sonar-core/src/test/resources/org/sonar/core/rule/RuleDaoTest/update-result.xml @@ -5,7 +5,7 @@ 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_coeff="1h" default_remediation_coeff="5d" remediation_offset="5min" default_remediation_offset="10h" effort_to_fix_description="squid.S115.effortToFix" /> diff --git a/sonar-server/src/main/java/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRules.java b/sonar-server/src/main/java/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRules.java index 248b00db06a..cbf1e521f53 100644 --- a/sonar-server/src/main/java/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRules.java +++ b/sonar-server/src/main/java/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRules.java @@ -117,8 +117,8 @@ public class CopyRequirementsFromCharacteristicsToRules { private static class RuleInputLoader implements MassUpdater.InputLoader<RuleRow>{ @Override public String selectSql() { - return "SELECT r.id,r.characteristic_id,r.remediation_function,r.remediation_factor,r.remediation_offset," + - "r.default_characteristic_id,r.default_remediation_function,r.default_remediation_factor,r.default_remediation_offset,r.status " + + return "SELECT r.id,r.characteristic_id,r.remediation_function,r.remediation_coeff,r.remediation_offset," + + "r.default_characteristic_id,r.default_remediation_function,r.default_remediation_coeff,r.default_remediation_offset,r.status " + "FROM rules r"; } @@ -151,7 +151,7 @@ public class CopyRequirementsFromCharacteristicsToRules { @Override public String updateSql() { - return "UPDATE rules SET characteristic_id=?,remediation_function=?,remediation_factor=?,remediation_offset=?,updated_at=? WHERE id=?"; + return "UPDATE rules SET characteristic_id=?,remediation_function=?,remediation_coeff=?,remediation_offset=?,updated_at=? WHERE id=?"; } @Override diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/523_update_rule_debt_columns.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/523_update_rule_debt_columns.rb new file mode 100644 index 00000000000..9e7b2b72133 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/523_update_rule_debt_columns.rb @@ -0,0 +1,50 @@ +# +# SonarQube, open source software quality management tool. +# Copyright (C) 2008-2014 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. +# + +# +# SonarQube 4.3 +# +# TO BE DELETED WHEN EXECUTED ON DORY +# +class UpdateRuleDebtColumns < ActiveRecord::Migration + + class Rule < ActiveRecord::Base + end + + def self.up + Metric.reset_column_information + + rename_column(:rules, :remediation_factor, :remediation_coeff) + rename_column(:rules, :default_remediation_factor, :default_remediation_coeff) + + # As CopyRequirementsFromCharacteristicsToRules has been updated to not insert 0X durations, we have update columns to reflect what should have been done. + + Rule.update_all("remediation_coeff=NULL", "remediation_coeff = '0d'" ) + Rule.update_all("remediation_coeff=NULL", "remediation_coeff = '0h'" ) + Rule.update_all("remediation_coeff=NULL", "remediation_coeff = '0min'" ) + Rule.update_all("remediation_coeff=NULL", "remediation_coeff = '0mn'" ) + + Rule.update_all("remediation_offset=NULL", "remediation_offset = '0d'" ) + Rule.update_all("remediation_offset=NULL", "remediation_offset = '0h'" ) + Rule.update_all("remediation_offset=NULL", "remediation_offset = '0min'" ) + Rule.update_all("remediation_offset=NULL", "remediation_offset = '0mn'" ) + end + +end diff --git a/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesTest.java b/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesTest.java index 7248d6d6718..a0fd69ff7f9 100644 --- a/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesTest.java +++ b/sonar-server/src/test/java/org/sonar/server/rule/RegisterRulesTest.java @@ -48,7 +48,7 @@ public class RegisterRulesTest 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_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", + "remediation_function", "default_remediation_function", "remediation_coeff", "default_remediation_coeff", "remediation_offset", "default_remediation_offset", "effort_to_fix_description"}; RegisterRules task; diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/ignore_rule_debt_definitions_if_rule_is_linked_on_root_characteristic.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/ignore_rule_debt_definitions_if_rule_is_linked_on_root_characteristic.xml index 2c69463ae43..f292f0a01f6 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/ignore_rule_debt_definitions_if_rule_is_linked_on_root_characteristic.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/ignore_rule_debt_definitions_if_rule_is_linked_on_root_characteristic.xml @@ -6,7 +6,7 @@ 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_coeff="[null]" default_remediation_coeff="14min" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="squid.S1115.effortTotFix"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/insert_new_rules-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/insert_new_rules-result.xml index 21cc3f9dab4..d0de3d15a9d 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/insert_new_rules-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/insert_new_rules-result.xml @@ -4,7 +4,7 @@ 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]"/> @@ -12,7 +12,7 @@ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java" characteristic_id="[null]" default_characteristic_id="2" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" - remediation_factor="[null]" default_remediation_factor="5d" + remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" effort_to_fix_description="squid.S115.effortToFix"/> @@ -31,7 +31,7 @@ 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_already_disabled_rules-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_already_disabled_rules-result.xml index c4b64d12430..b78b8804371 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_already_disabled_rules-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_already_disabled_rules-result.xml @@ -4,7 +4,7 @@ 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]" updated_at="2014-03-16"/> @@ -13,7 +13,7 @@ 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]" updated_at="2014-03-16"/> @@ -23,7 +23,7 @@ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java" characteristic_id="[null]" default_characteristic_id="2" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" - remediation_factor="[null]" default_remediation_factor="5d" + remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" effort_to_fix_description="squid.S115.effortToFix" updated_at="2014-03-17 19:10:03.0"/> @@ -32,7 +32,7 @@ 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]" updated_at="2014-03-17 19:10:03.0"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_already_disabled_rules.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_already_disabled_rules.xml index 27a03f91411..a512738cc04 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_already_disabled_rules.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/not_disable_already_disabled_rules.xml @@ -6,7 +6,7 @@ status="REMOVED" priority="4" cardinality="SINGLE" 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]" updated_at="2014-03-16"/> @@ -15,7 +15,7 @@ status="REMOVED" priority="4" cardinality="SINGLE" 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]" updated_at="2014-03-16"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_characteristic_not_found-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_characteristic_not_found-result.xml index 89e5191d7fd..3fd0dc9c746 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_characteristic_not_found-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_characteristic_not_found-result.xml @@ -4,7 +4,7 @@ status="READY" priority="4" 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]"/> @@ -12,7 +12,7 @@ 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_characteristic_not_found.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_characteristic_not_found.xml index 14495983726..4ccf94bbaa3 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_characteristic_not_found.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_characteristic_not_found.xml @@ -6,7 +6,7 @@ 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_coeff="[null]" default_remediation_coeff="14min" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_default_characteristic_not_found_and_overriding_characteristic_disabled-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_default_characteristic_not_found_and_overriding_characteristic_disabled-result.xml index fcb2b867045..6046c08a0cd 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_default_characteristic_not_found_and_overriding_characteristic_disabled-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_default_characteristic_not_found_and_overriding_characteristic_disabled-result.xml @@ -4,7 +4,7 @@ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java" characteristic_id="-1" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" - remediation_factor="[null]" default_remediation_factor="[null]" + remediation_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]"/> @@ -12,7 +12,7 @@ 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_default_characteristic_not_found_and_overriding_characteristic_disabled.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_default_characteristic_not_found_and_overriding_characteristic_disabled.xml index fd2c3d8e489..1a5aac45ef0 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_default_characteristic_not_found_and_overriding_characteristic_disabled.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_characteristic_when_default_characteristic_not_found_and_overriding_characteristic_disabled.xml @@ -6,7 +6,7 @@ status="READY" priority="2" cardinality="SINGLE" parent_id="[null]" characteristic_id="-1" default_characteristic_id="[null]" remediation_function="[null]" default_remediation_function="[null]" - remediation_factor="[null]" default_remediation_factor="[null]" + remediation_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]"/> @@ -14,7 +14,7 @@ status="READY" priority="1" cardinality="SINGLE" 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_default_characteristic_when_default_characteristic_not_found_but_characteristic_has_been_overridden-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_default_characteristic_when_default_characteristic_not_found_but_characteristic_has_been_overridden-result.xml index 9fcf2872bb9..1ccbc8dfb68 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_default_characteristic_when_default_characteristic_not_found_but_characteristic_has_been_overridden-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_default_characteristic_when_default_characteristic_not_found_but_characteristic_has_been_overridden-result.xml @@ -4,7 +4,7 @@ status="READY" priority="4" cardinality="SINGLE" parent_id="[null]" language="java" characteristic_id="3" default_characteristic_id="[null]" remediation_function="LINEAR_OFFSET" default_remediation_function="[null]" - remediation_factor="5d" default_remediation_factor="[null]" + remediation_coeff="5d" default_remediation_coeff="[null]" remediation_offset="10h" default_remediation_offset="[null]" effort_to_fix_description="[null]"/> @@ -12,7 +12,7 @@ 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_default_characteristic_when_default_characteristic_not_found_but_characteristic_has_been_overridden.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_default_characteristic_when_default_characteristic_not_found_but_characteristic_has_been_overridden.xml index 66458e67ee3..4a0da7b3377 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_default_characteristic_when_default_characteristic_not_found_but_characteristic_has_been_overridden.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/set_no_default_characteristic_when_default_characteristic_not_found_but_characteristic_has_been_overridden.xml @@ -8,7 +8,7 @@ status="READY" priority="2" cardinality="SINGLE" parent_id="[null]" characteristic_id="3" default_characteristic_id="[null]" remediation_function="LINEAR_OFFSET" default_remediation_function="[null]" - remediation_factor="5d" default_remediation_factor="[null]" + remediation_coeff="5d" default_remediation_coeff="[null]" remediation_offset="10h" default_remediation_offset="[null]" effort_to_fix_description="[null]"/> @@ -16,7 +16,7 @@ status="READY" priority="1" cardinality="SINGLE" 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_fields-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_fields-result.xml index 4c832441dd4..214576567d6 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_fields-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_fields-result.xml @@ -4,7 +4,7 @@ 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_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" effort_to_fix_description="squid.S115.effortToFix"/> @@ -25,7 +25,7 @@ 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_fields.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_fields.xml index 5a04a1672f5..158e65dd3dd 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_fields.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_rule_fields.xml @@ -6,7 +6,7 @@ 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_coeff="[null]" default_remediation_coeff="14min" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]"/> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_template_rule_language-result.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_template_rule_language-result.xml index 0fc47887777..10e1584dd73 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_template_rule_language-result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_template_rule_language-result.xml @@ -4,7 +4,7 @@ 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_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" effort_to_fix_description="squid.S115.effortToFix" /> @@ -13,7 +13,7 @@ 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_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" effort_to_fix_description="squid.S115.effortToFix" /> @@ -21,7 +21,7 @@ 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]" /> @@ -30,7 +30,7 @@ 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]" /> diff --git a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_template_rule_language.xml b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_template_rule_language.xml index 2813575401e..3328bafc00c 100644 --- a/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_template_rule_language.xml +++ b/sonar-server/src/test/resources/org/sonar/server/rule/RegisterRulesTest/update_template_rule_language.xml @@ -6,7 +6,7 @@ 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_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" effort_to_fix_description="squid.S115.effortToFix" /> @@ -15,7 +15,7 @@ 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_coeff="[null]" default_remediation_coeff="1h" remediation_offset="[null]" default_remediation_offset="15min" effort_to_fix_description="squid.S115.effortToFix2" /> @@ -23,7 +23,7 @@ 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]" /> @@ -32,7 +32,7 @@ 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_coeff="[null]" default_remediation_coeff="[null]" remediation_offset="[null]" default_remediation_offset="[null]" effort_to_fix_description="[null]" /> diff --git a/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/copy_requirements_from_characteristics_to_rules.xml b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/copy_requirements_from_characteristics_to_rules.xml index 9b96cf3de42..a90e960c94e 100644 --- a/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/copy_requirements_from_characteristics_to_rules.xml +++ b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/copy_requirements_from_characteristics_to_rules.xml @@ -4,35 +4,35 @@ <rules id="1" plugin_rule_key="UselessImportCheck" plugin_name="squid" name="UselessImportCheck" description="Useless imports should be removed" status="READY" characteristic_id="[null]" default_characteristic_id="10" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" - remediation_factor="[null]" default_remediation_factor="5d" + remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19"/> <!-- Rule linked to a disabled requirement -> Update rule to disable characteristic --> <rules id="2" plugin_rule_key="LeftCurlyBraceStartLineCheck" plugin_name="squid" name="LeftCurlyBraceStartLineCheck" description="Left curly braces should be located at the beginning of lines of code" status="READY" characteristic_id="[null]" default_characteristic_id="10" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" - remediation_factor="[null]" default_remediation_factor="5d" + remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19"/> <!-- Removed rule linked to a disabled requirement -> Do nothing --> <rules id="3" plugin_rule_key="CallToFileDeleteOnExitMethod" plugin_name="squid" name="CallToFileDeleteOnExitMethod" description="CallToFileDeleteOnExitMethod" status="REMOVED" characteristic_id="[null]" default_characteristic_id="10" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" - remediation_factor="[null]" default_remediation_factor="5d" + remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19"/> <!-- Rule linked to one enable requirement, with same value of debt -> Nothing to do --> <rules id="4" plugin_rule_key="ObjectFinalizeOverridenCallsSuperFinalizeCheck" plugin_name="squid" name="ObjectFinalizeOverridenCallsSuperFinalizeCheck" description="super.finalize() should be called at the end of Object.finalize() implementations" status="READY" characteristic_id="[null]" default_characteristic_id="10" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" - remediation_factor="[null]" default_remediation_factor="5min" + remediation_coeff="[null]" default_remediation_coeff="5min" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19"/> <!-- Rule linked to one enable requirement, with different value of debt -> Update rule --> <rules id="5" plugin_rule_key="RightCurlyBraceStartLineCheck" plugin_name="squid" name="RightCurlyBraceStartLineCheck" description="Right curly braces should be located at the beginning of lines of code" status="READY" characteristic_id="[null]" default_characteristic_id="20" remediation_function="[null]" default_remediation_function="LINEAR" - remediation_factor="[null]" default_remediation_factor="5d" + remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="[null]" updated_at="2014-02-19"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/copy_requirements_from_characteristics_to_rules_result.xml b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/copy_requirements_from_characteristics_to_rules_result.xml index 503f39a1d6d..83fc74c8813 100644 --- a/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/copy_requirements_from_characteristics_to_rules_result.xml +++ b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/copy_requirements_from_characteristics_to_rules_result.xml @@ -4,35 +4,35 @@ <rules id="1" plugin_rule_key="UselessImportCheck" plugin_name="squid" name="UselessImportCheck" description="Useless imports should be removed" status="READY" characteristic_id="[null]" default_characteristic_id="10" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" - remediation_factor="[null]" default_remediation_factor="5d" + remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19"/> <!-- Rule linked to a disabled requirements -> Update rule to disable characteristic --> <rules id="2" plugin_rule_key="LeftCurlyBraceStartLineCheck" plugin_name="squid" name="LeftCurlyBraceStartLineCheck" description="Left curly braces should be located at the beginning of lines of code" status="READY" characteristic_id="-1" default_characteristic_id="10" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" - remediation_factor="[null]" default_remediation_factor="5d" + remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-03-13 19:10:03.0"/> <!-- Removed rule linked to a disabled requirement -> Do nothing --> <rules id="3" plugin_rule_key="CallToFileDeleteOnExitMethod" plugin_name="squid" name="CallToFileDeleteOnExitMethod" description="CallToFileDeleteOnExitMethod" status="REMOVED" characteristic_id="[null]" default_characteristic_id="10" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" - remediation_factor="[null]" default_remediation_factor="5d" + remediation_coeff="[null]" default_remediation_coeff="5d" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19"/> <!-- Rule linked to one enable requirement, with same value of debt -> Nothing to do --> <rules id="4" plugin_rule_key="ObjectFinalizeOverridenCallsSuperFinalizeCheck" plugin_name="squid" name="ObjectFinalizeOverridenCallsSuperFinalizeCheck" description="super.finalize() should be called at the end of Object.finalize() implementations" status="READY" characteristic_id="[null]" default_characteristic_id="10" remediation_function="[null]" default_remediation_function="LINEAR_OFFSET" - remediation_factor="[null]" default_remediation_factor="5min" + remediation_coeff="[null]" default_remediation_coeff="5min" remediation_offset="[null]" default_remediation_offset="10h" updated_at="2014-02-19"/> <!-- Rule linked to one enable requirement, with different value of debt -> Update rule --> <rules id="5" plugin_rule_key="RightCurlyBraceStartLineCheck" plugin_name="squid" name="RightCurlyBraceStartLineCheck" description="Right curly braces should be located at the beginning of lines of code" status="READY" characteristic_id="10" default_characteristic_id="20" remediation_function="LINEAR_OFFSET" default_remediation_function="LINEAR" - remediation_factor="20min" default_remediation_factor="5d" + remediation_coeff="20min" default_remediation_coeff="5d" remediation_offset="30h" default_remediation_offset="[null]" updated_at="2014-03-13 19:10:03.0"/> </dataset> diff --git a/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/schema.sql b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/schema.sql index 3f02904a610..da87904a95c 100644 --- a/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/schema.sql +++ b/sonar-server/src/test/resources/org/sonar/server/startup/CopyRequirementsFromCharacteristicsToRulesTest/schema.sql @@ -9,8 +9,8 @@ CREATE TABLE "RULES" ( "DEFAULT_CHARACTERISTIC_ID" INTEGER, "REMEDIATION_FUNCTION" VARCHAR(20), "DEFAULT_REMEDIATION_FUNCTION" VARCHAR(20), - "REMEDIATION_FACTOR" VARCHAR(20), - "DEFAULT_REMEDIATION_FACTOR" VARCHAR(20), + "REMEDIATION_COEFF" VARCHAR(20), + "DEFAULT_REMEDIATION_COEFF" VARCHAR(20), "REMEDIATION_OFFSET" VARCHAR(20), "DEFAULT_REMEDIATION_OFFSET" VARCHAR(20), "UPDATED_AT" TIMESTAMP |