From: simonbrandhof Date: Wed, 22 Sep 2010 13:29:23 +0000 (+0000) Subject: SONAR-1798 rename RULE_FAILURES.POINTS to COST X-Git-Tag: 2.6~982 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=365a5dbae8f05b95f55637659d392688474a1730;p=sonarqube.git SONAR-1798 rename RULE_FAILURES.POINTS to COST --- diff --git a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/purges/PurgeDeletedResourcesTest/purgeDeletedResources-result.xml b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/purges/PurgeDeletedResourcesTest/purgeDeletedResources-result.xml index 20a21ee945e..e9bcbeea46c 100644 --- a/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/purges/PurgeDeletedResourcesTest/purgeDeletedResources-result.xml +++ b/plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/purges/PurgeDeletedResourcesTest/purgeDeletedResources-result.xml @@ -26,10 +26,10 @@ - - - - + + + + - - - - + + + + --> - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - + + - - - - + + + + - - + + --> - - - - + + + + - - - - + + + + setCost() + */ + public Double getCost() { + return cost; } - public Violation setPoints(Double d) { - this.points = d; + /** + * The cost to fix a violation can't be precisely computed without this information. + * Let's take the following example : a rule forbids to have methods whose complexity is greater than 10. Without this field "cost", + * the same violation is created with a method whose complexity is 15 and a method whose complexity is 100. + * If the cost to fix one point of complexity is 0.05h, then 15mn is necessary to fix the method whose complexity is 15, + * and 3h5mn is required to fix the method whose complexity is 100. + */ + public Violation setCost(Double d) { + this.cost = d; return this; } diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/141_add_rule_failures_cost.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/141_add_rule_failures_cost.rb new file mode 100644 index 00000000000..c2cf2737298 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/141_add_rule_failures_cost.rb @@ -0,0 +1,26 @@ +# +# Sonar, entreprise quality control tool. +# Copyright (C) 2009 SonarSource SA +# mailto:contact AT sonarsource DOT com +# +# Sonar 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. +# +# Sonar 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 Sonar; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 +# +class AddRuleFailuresCost < ActiveRecord::Migration + + def self.up + add_column 'rule_failures', 'cost', :decimal, :null => true, :precision => 30, :scale => 20 + end + +end diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/141_add_rule_failures_points.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/141_add_rule_failures_points.rb deleted file mode 100644 index e3df02105b1..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/141_add_rule_failures_points.rb +++ /dev/null @@ -1,26 +0,0 @@ -# -# Sonar, entreprise quality control tool. -# Copyright (C) 2009 SonarSource SA -# mailto:contact AT sonarsource DOT com -# -# Sonar 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. -# -# Sonar 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 Sonar; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 -# -class AddRuleFailuresPoints < ActiveRecord::Migration - - def self.up - add_column 'rule_failures', 'points', :decimal, :null => true, :precision => 30, :scale => 20 - end - -end