]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-1798 rename RULE_FAILURES.POINTS to COST
authorsimonbrandhof <simon.brandhof@gmail.com>
Wed, 22 Sep 2010 13:29:23 +0000 (13:29 +0000)
committersimonbrandhof <simon.brandhof@gmail.com>
Wed, 22 Sep 2010 13:29:23 +0000 (13:29 +0000)
17 files changed:
plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/purges/PurgeDeletedResourcesTest/purgeDeletedResources-result.xml
plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/purges/PurgeDeletedResourcesTest/purgeDeletedResources.xml
plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/purges/PurgeDeprecatedLastTest/purgeDeprecatedLast-result.xml
plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/purges/PurgeDeprecatedLastTest/purgeDeprecatedLast.xml
plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/purges/PurgeEntitiesTest/purgeEntities-result.xml
plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/purges/PurgeEntitiesTest/purgeEntities.xml
plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/purges/PurgeUnprocessedTest/purgeUnprocessed-result.xml
plugins/sonar-core-plugin/src/test/resources/org/sonar/plugins/core/purges/PurgeUnprocessedTest/purgeUnprocessed.xml
sonar-batch/src/main/java/org/sonar/batch/ViolationsDao.java
sonar-batch/src/test/resources/org/sonar/batch/FinalizeSnapshotsJobTest/lastSnapshotIsNotUpdatedWhenAnalyzingPastSnapshot-result.xml
sonar-batch/src/test/resources/org/sonar/batch/FinalizeSnapshotsJobTest/lastSnapshotIsNotUpdatedWhenAnalyzingPastSnapshot.xml
sonar-core/src/test/resources/org/sonar/core/purge/AbstractPurgeTest/purgeSnapshots-result.xml
sonar-core/src/test/resources/org/sonar/core/purge/AbstractPurgeTest/purgeSnapshots.xml
sonar-plugin-api/src/main/java/org/sonar/api/database/model/RuleFailureModel.java
sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java
sonar-server/src/main/webapp/WEB-INF/db/migrate/141_add_rule_failures_cost.rb [new file with mode: 0644]
sonar-server/src/main/webapp/WEB-INF/db/migrate/141_add_rule_failures_points.rb [deleted file]

index 20a21ee945ec8f1b65b3e9e9fa82e9e4c860de6b..e9bcbeea46ce104e45d6a8f5a0e154f90ecf1403 100644 (file)
   <SNAPSHOT_SOURCES ID="2" SNAPSHOT_ID="4" DATA="foo"/>
 
 
-  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" POINTS="[null]"/>
-  <!--<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" POINTS="[null]"/>-->
-  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" POINTS="[null]"/>
+  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]"/>
+  <!--<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]"/>-->
+  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]"/>
 
   <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]"
                     rule_priority="[null]"
index 149c5c34c0a865cacdd15ebcfff9855a889d796c..a67a05e5291e187842307282e8498f10d1fd0760 100644 (file)
   <SNAPSHOT_SOURCES ID="2" SNAPSHOT_ID="4" DATA="foo"/>
 
 
-  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" POINTS="[null]"/>
+  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]"/>
 
   <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]"
                     rule_priority="[null]"
index 09f36ebad9d29e3835449beab77328e7ff769064..5c3493f167f218f126690b638db0401894dc6d58 100644 (file)
   <!--<SNAPSHOT_SOURCES ID="1" SNAPSHOT_ID="3" DATA="foo"/>-->
   <SNAPSHOT_SOURCES ID="2" SNAPSHOT_ID="4" DATA="foo"/>
 
-  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" POINTS="[null]"/>
-  <!--<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" POINTS="[null]"/>-->
-  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" POINTS="[null]"/>
+  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]"/>
+  <!--<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]"/>-->
+  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]"/>
 
 
   <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]"
index 53a985c7420628495a92258522cc1e107bca0781..baad4416b017826f2645fd5ccc730c7f70559d9a 100644 (file)
   <SNAPSHOT_SOURCES ID="1" SNAPSHOT_ID="3" DATA="foo"/>
   <SNAPSHOT_SOURCES ID="2" SNAPSHOT_ID="4" DATA="foo"/>
 
-  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" POINTS="[null]"/>
+  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]"/>
 
 
   <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]"
index beef4dee1201354af12411823f3658529a25caae..796b6b9e5760cf3718fefe4aa1889cd8b98d21d2 100644 (file)
 
 
   <!-- old violations -->
-  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" POINTS="[null]"/>
-  <!--<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" POINTS="[null]"/>-->
-  <!--<RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" POINTS="[null]"/>-->
+  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]"/>
+  <!--<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" COST="[null]"/>-->
+  <!--<RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" COST="[null]"/>-->
 
 
   <!-- last violations -->
-  <RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" POINTS="[null]"/>
-  <RULE_FAILURES ID="6" SNAPSHOT_ID="6" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" POINTS="[null]"/>
-  <RULE_FAILURES ID="7" SNAPSHOT_ID="7" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" POINTS="[null]"/>
-  <RULE_FAILURES ID="8" SNAPSHOT_ID="8" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" POINTS="[null]"/>
+  <RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" COST="[null]"/>
+  <RULE_FAILURES ID="6" SNAPSHOT_ID="6" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" COST="[null]"/>
+  <RULE_FAILURES ID="7" SNAPSHOT_ID="7" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" COST="[null]"/>
+  <RULE_FAILURES ID="8" SNAPSHOT_ID="8" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" COST="[null]"/>
 
   <!-- old measures -->
   <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]"
index 024cb056f825f34c780755bff5e619f03513d1ea..6f34d16ace9edbb19573bcaf0d05e532ca4032c0 100644 (file)
 
 
   <!-- old violations -->
-  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" POINTS="[null]"/>
+  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]"/>
 
 
   <!-- last violations -->
-  <RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="6" SNAPSHOT_ID="6" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="7" SNAPSHOT_ID="7" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="8" SNAPSHOT_ID="8" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" POINTS="[null]"/>
+  <RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="6" SNAPSHOT_ID="6" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="7" SNAPSHOT_ID="7" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="8" SNAPSHOT_ID="8" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]"/>
 
   <!-- old measures -->
   <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]"
index 924ca9c69431eb84d6b7ab6f61b205a1cb8e2cd3..c86354320cde6a91d7f3d5d44325c31ae037a257 100644 (file)
 
 
   <!-- valid violations -->
-  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" POINTS="[null]"/>
+  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]"/>
 
 
   <!-- unprocessed violations -->
-  <!--<RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" POINTS="[null]"/>-->
-  <!--<RULE_FAILURES ID="6" SNAPSHOT_ID="6" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" POINTS="[null]"/>-->
-  <!--<RULE_FAILURES ID="7" SNAPSHOT_ID="7" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" POINTS="[null]"/>-->
-  <!--<RULE_FAILURES ID="8" SNAPSHOT_ID="8" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" POINTS="[null]"/>-->
+  <!--<RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]"/>-->
+  <!--<RULE_FAILURES ID="6" SNAPSHOT_ID="6" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]"/>-->
+  <!--<RULE_FAILURES ID="7" SNAPSHOT_ID="7" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]"/>-->
+  <!--<RULE_FAILURES ID="8" SNAPSHOT_ID="8" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]"/>-->
 
   <!-- valid measures -->
   <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]"
index d6a3480f8519bd52883d2696f37af896119dce61..d0bbb1424bbbbe7800a0895550aa01c1a2eb339d 100644 (file)
 
 
   <!-- valid violations -->
-  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" POINTS="[null]"/>
+  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]"/>
 
 
   <!-- unprocessed violations -->
-  <RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="6" SNAPSHOT_ID="6" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="7" SNAPSHOT_ID="7" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="8" SNAPSHOT_ID="8" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" POINTS="[null]"/>
+  <RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="6" SNAPSHOT_ID="6" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="7" SNAPSHOT_ID="7" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="8" SNAPSHOT_ID="8" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]"/>
 
   <!-- valid measures -->
   <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]"
index 4ff285fdd603874dc25a17e775a1a35f3b705f61..41393753a52dfc188348c9d8c1be5cee1027b1d7 100644 (file)
@@ -56,7 +56,7 @@ public class ViolationsDao {
       violation.setLineId(model.getLine());
       violation.setMessage(model.getMessage());
       violation.setPriority(model.getPriority());
-      violation.setPoints(model.getPoints());
+      violation.setCost(model.getCost());
       violations.add(violation);
     }
     return violations;
@@ -90,7 +90,7 @@ public class ViolationsDao {
     violation.setPriority(activeRule.getPriority());
     model.setLine(violation.getLineId());
     model.setMessage(violation.getMessage());
-    model.setPoints(violation.getPoints());
+    model.setCost(violation.getCost());
     model.setSnapshotId(snapshot.getId());
 
     return model;
index 4179864dc7cb0b1ab8fe771756dea0a98cf5fe09..909141c4f5bc40083d5644cc3b57936f71d78840 100644 (file)
   <SNAPSHOT_SOURCES ID="1" SNAPSHOT_ID="4" DATA="source code of Class1"/>
   <SNAPSHOT_SOURCES ID="2" SNAPSHOT_ID="5" DATA="source code of Class2"/>
 
-  <RULE_FAILURES ID="1" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" POINTS="[null]"/>
-  <RULE_FAILURES ID="2" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" POINTS="[null]"/>
-  <RULE_FAILURES ID="3" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" POINTS="[null]"/>
-  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" POINTS="[null]"/>
+  <RULE_FAILURES ID="1" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" COST="[null]"/>
+  <RULE_FAILURES ID="2" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" COST="[null]"/>
+  <RULE_FAILURES ID="3" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" COST="[null]"/>
+  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" COST="[null]"/>
 
-  <RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg5" POINTS="[null]"/>
-  <RULE_FAILURES ID="6" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg6" POINTS="[null]"/>
+  <RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg5" COST="[null]"/>
+  <RULE_FAILURES ID="6" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg6" COST="[null]"/>
 
   <!-- measures at project level -->
   <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]"
index fd95bbf2afba470b1d89103496f054a0bb0da5a4..523a66915f4f5f9587b54e0215a6e2710088cc8a 100644 (file)
   <SNAPSHOT_SOURCES ID="1" SNAPSHOT_ID="4" DATA="source code of Class1"/>
   <SNAPSHOT_SOURCES ID="2" SNAPSHOT_ID="5" DATA="source code of Class2"/>
 
-  <RULE_FAILURES ID="1" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" POINTS="[null]"/>
-  <RULE_FAILURES ID="2" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" POINTS="[null]"/>
-  <RULE_FAILURES ID="3" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" POINTS="[null]"/>
-  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" POINTS="[null]"/>
+  <RULE_FAILURES ID="1" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" COST="[null]"/>
+  <RULE_FAILURES ID="2" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" COST="[null]"/>
+  <RULE_FAILURES ID="3" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" COST="[null]"/>
+  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" COST="[null]"/>
 
-  <RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg5" POINTS="[null]"/>
-  <RULE_FAILURES ID="6" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg6" POINTS="[null]"/>
+  <RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg5" COST="[null]"/>
+  <RULE_FAILURES ID="6" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg6" COST="[null]"/>
 
   <!-- measures at project level -->
   <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]"
index 416d80ff28980d0f3eeb18182d3bf0fa256b06cd..f5039b0e8ec43d285557edf0e67cd36d43e9d7b7 100644 (file)
   <!--<SNAPSHOT_SOURCES ID="2" SNAPSHOT_ID="4" DATA="some sources"/>-->
 
 
-  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" POINTS="[null]"/>
-  <!--<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" POINTS="[null]"/>-->
-  <!--<RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" POINTS="[null]"/>-->
+  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]"/>
+  <!--<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]"/>-->
+  <!--<RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]"/>-->
 
 
   <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]"
index b0e60b31eb5eb6ea82fb35d24787dd40e7fee869..93ef910270a6c0f27b75ec78cc4b92be9b75855d 100644 (file)
   <SNAPSHOT_SOURCES ID="2" SNAPSHOT_ID="4" DATA="some sources"/>
 
 
-  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" POINTS="[null]"/>
-  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" POINTS="[null]"/>
+  <RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]"/>
+  <RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]"/>
 
 
   <project_measures characteristic_id="[null]" url="[null]" diff_value_1="[null]" diff_value_2="[null]" diff_value_3="[null]"
index df13d3cdaceafa94753ca328da42e497d48484a1..fe06d79ab8ebd906316bfb614e65236d46ec365d 100644 (file)
@@ -52,8 +52,8 @@ public class RuleFailureModel extends BaseIdentifiable {
   @Column(name = "line", updatable = true, nullable = true)
   private Integer line;
 
-  @Column(name = "points", updatable = true, nullable = true)
-  private Double points;
+  @Column(name = "cost", updatable = true, nullable = true)
+  private Double cost;
 
   public RuleFailureModel() {
   }
@@ -112,12 +112,12 @@ public class RuleFailureModel extends BaseIdentifiable {
     this.line = line;
   }
 
-  public Double getPoints() {
-    return points;
+  public Double getCost() {
+    return cost;
   }
 
-  public RuleFailureModel setPoints(Double d) {
-    this.points = d;
+  public RuleFailureModel setCost(Double d) {
+    this.cost = d;
     return this;
   }
 
index ffe819da40840ddcadf67a1732cde8c27d340a4b..2e6c914011f789263584b745e74a28c58f8c4b45 100644 (file)
@@ -34,7 +34,7 @@ public class Violation {
   private String message;
   private RulePriority priority;
   private Integer lineId;
-  private Double points;
+  private Double cost;
 
   /**
    * Creates of a violation from a rule. Will need to define the resource later on
@@ -124,12 +124,22 @@ public class Violation {
     return this;
   }
 
-  public Double getPoints() {
-    return points;
+  /**
+   * @see <code>setCost()</code>
+   */
+  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 (file)
index 0000000..c2cf273
--- /dev/null
@@ -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 (file)
index e3df021..0000000
+++ /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