mirror of
https://github.com/SonarSource/sonarqube.git
synced 2024-08-03 08:18:00 +02:00
SONAR-2347 Add the column RULE_FAILURES.PERMANENT_ID
This commit is contained in:
parent
3f782b64d7
commit
f3461ab00d
@ -95,12 +95,9 @@ public class ViolationPersisterDecorator implements Decorator {
|
||||
if (pastViolation != null) {
|
||||
// remove violation, since would be updated and shouldn't affect other violations anymore
|
||||
pastViolationsByRule.remove(violation.getRule(), pastViolation);
|
||||
violation.setCreatedAt(pastViolation.getCreatedAt());
|
||||
} else {
|
||||
violation.setCreatedAt(null);//avoid plugins to set date
|
||||
}
|
||||
String checksum = getChecksumForLine(checksums, violation.getLineId());
|
||||
violationPersister.saveViolation(context.getProject(), violation, checksum);
|
||||
violationPersister.saveViolation(context.getProject(), violation, pastViolation, checksum);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -56,10 +56,10 @@
|
||||
<!--<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]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<!--<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
<!--<RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
<rule_failures permanent_id="[null]" ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<!--<rule_failures permanent_id="[null]" ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
<!--<rule_failures permanent_id="[null]" ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
|
||||
|
||||
<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
|
||||
|
@ -56,10 +56,10 @@
|
||||
<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]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
|
||||
|
||||
<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
|
||||
|
@ -26,10 +26,10 @@
|
||||
<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]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<!--<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
<RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<!--<rule_failures permanent_id="[null]" ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
<rule_failures permanent_id="[null]" ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
|
||||
<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
|
||||
rule_priority="[null]"
|
||||
|
@ -26,10 +26,10 @@
|
||||
<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]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
|
||||
<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
|
||||
rule_priority="[null]"
|
||||
|
@ -28,10 +28,10 @@
|
||||
<!--<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]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<!--<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
<RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<!--<rule_failures permanent_id="[null]" ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
<rule_failures permanent_id="[null]" ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
|
||||
|
||||
<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
|
||||
|
@ -28,10 +28,10 @@
|
||||
<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]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
|
||||
|
||||
<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
|
||||
|
@ -54,17 +54,17 @@
|
||||
|
||||
|
||||
<!-- old violations -->
|
||||
<RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<!--<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
<!--<RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
<rule_failures permanent_id="[null]" ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<!--<rule_failures permanent_id="[null]" ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
<!--<rule_failures permanent_id="[null]" ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
|
||||
|
||||
<!-- last violations -->
|
||||
<RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="6" SNAPSHOT_ID="6" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="7" SNAPSHOT_ID="7" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="8" SNAPSHOT_ID="8" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="6" SNAPSHOT_ID="6" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="7" SNAPSHOT_ID="7" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="8" SNAPSHOT_ID="8" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
|
||||
<!-- old measures -->
|
||||
<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
|
||||
|
@ -54,17 +54,17 @@
|
||||
|
||||
|
||||
<!-- old violations -->
|
||||
<RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
|
||||
|
||||
<!-- last violations -->
|
||||
<RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="6" SNAPSHOT_ID="6" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="7" SNAPSHOT_ID="7" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="8" SNAPSHOT_ID="8" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="6" SNAPSHOT_ID="6" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="7" SNAPSHOT_ID="7" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="8" SNAPSHOT_ID="8" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
|
||||
<!-- old measures -->
|
||||
<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
|
||||
|
@ -54,17 +54,17 @@
|
||||
|
||||
|
||||
<!-- valid violations -->
|
||||
<RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
|
||||
|
||||
<!-- unprocessed violations -->
|
||||
<!--<RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
<!--<RULE_FAILURES ID="6" SNAPSHOT_ID="6" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
<!--<RULE_FAILURES ID="7" SNAPSHOT_ID="7" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
<!--<RULE_FAILURES ID="8" SNAPSHOT_ID="8" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
<!--<rule_failures permanent_id="[null]" ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
<!--<rule_failures permanent_id="[null]" ID="6" SNAPSHOT_ID="6" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
<!--<rule_failures permanent_id="[null]" ID="7" SNAPSHOT_ID="7" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
<!--<rule_failures permanent_id="[null]" ID="8" SNAPSHOT_ID="8" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>-->
|
||||
|
||||
<!-- valid measures -->
|
||||
<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
|
||||
|
@ -54,17 +54,17 @@
|
||||
|
||||
|
||||
<!-- valid violations -->
|
||||
<RULE_FAILURES ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="1" SNAPSHOT_ID="1" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="2" SNAPSHOT_ID="2" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="3" SNAPSHOT_ID="3" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="4" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
|
||||
|
||||
<!-- unprocessed violations -->
|
||||
<RULE_FAILURES ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="6" SNAPSHOT_ID="6" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="7" SNAPSHOT_ID="7" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="8" SNAPSHOT_ID="8" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="6" SNAPSHOT_ID="6" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="7" SNAPSHOT_ID="7" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="8" SNAPSHOT_ID="8" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg4" LINE="[null]" COST="[null]" created_at="2008-12-02 13:58:00.00" checksum="[null]"/>
|
||||
|
||||
<!-- valid measures -->
|
||||
<project_measures characteristic_id="[null]" url="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
|
||||
|
@ -40,19 +40,33 @@ public final class ViolationPersister {
|
||||
}
|
||||
|
||||
void saveViolation(Project project, Violation violation) {
|
||||
saveViolation(project, violation, null);
|
||||
saveViolation(project, violation, null, null);
|
||||
}
|
||||
|
||||
public void saveViolation(Project project, Violation violation, String checksum) {
|
||||
public void saveViolation(Project project, Violation violation, RuleFailureModel pastViolation, String checksum) {
|
||||
Snapshot snapshot = resourcePersister.saveResource(project, violation.getResource());
|
||||
if (violation.getCreatedAt()==null) {
|
||||
violation.setCreatedAt(snapshot.getCreatedAt());
|
||||
}
|
||||
|
||||
RuleFailureModel model = createModel(violation);
|
||||
if (pastViolation!=null) {
|
||||
model.setCreatedAt(pastViolation.getCreatedAt());
|
||||
model.setPermanentId(pastViolation.getPermanentId());
|
||||
|
||||
} else {
|
||||
// avoid plugins setting date
|
||||
model.setCreatedAt(snapshot.getCreatedAt());
|
||||
}
|
||||
model.setSnapshotId(snapshot.getId());
|
||||
model.setChecksum(checksum);
|
||||
session.save(model);
|
||||
|
||||
if (model.getPermanentId()==null) {
|
||||
model.setPermanentId(model.getId());
|
||||
session.save(model);
|
||||
}
|
||||
|
||||
// the following fields can have been changed
|
||||
violation.setMessage(model.getMessage());// the message can be changed in the class RuleFailure (truncate + trim)
|
||||
violation.setCreatedAt(model.getCreatedAt());
|
||||
}
|
||||
|
||||
private RuleFailureModel createModel(Violation violation) {
|
||||
@ -60,7 +74,6 @@ public final class ViolationPersister {
|
||||
Rule rule = ruleFinder.findByKey(violation.getRule().getRepositoryKey(), violation.getRule().getKey());
|
||||
model.setRuleId(rule.getId());
|
||||
model.setPriority(violation.getSeverity());
|
||||
model.setCreatedAt(violation.getCreatedAt());
|
||||
model.setLine(violation.getLineId());
|
||||
model.setMessage(violation.getMessage());
|
||||
model.setCost(violation.getCost());
|
||||
|
@ -31,8 +31,6 @@ import org.sonar.api.rules.Violation;
|
||||
import org.sonar.core.components.DefaultRuleFinder;
|
||||
import org.sonar.jpa.test.AbstractDbUnitTestCase;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.notNullValue;
|
||||
import static org.mockito.Matchers.anyObject;
|
||||
import static org.mockito.Matchers.eq;
|
||||
import static org.mockito.Mockito.mock;
|
||||
@ -44,6 +42,7 @@ public class ViolationPersisterTest extends AbstractDbUnitTestCase {
|
||||
private Rule rule1 = Rule.create("checkstyle", "com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck", "Check Header");
|
||||
private Rule rule2 = Rule.create("checkstyle", "com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck", "Equals Avoid Null");
|
||||
private JavaFile javaFile = new JavaFile("org.foo.Bar");
|
||||
Project project = new Project("project");
|
||||
|
||||
@Before
|
||||
public void before() {
|
||||
@ -64,7 +63,6 @@ public class ViolationPersisterTest extends AbstractDbUnitTestCase {
|
||||
.setSeverity(RulePriority.CRITICAL).setLineId(50).setCost(80.0);
|
||||
Violation violation2 = Violation.create(rule2, javaFile)
|
||||
.setSeverity(RulePriority.MINOR);
|
||||
Project project = new Project("project");
|
||||
|
||||
violationPersister.saveViolation(project, violation1a);
|
||||
violationPersister.saveViolation(project, violation1b);
|
||||
@ -73,4 +71,13 @@ public class ViolationPersisterTest extends AbstractDbUnitTestCase {
|
||||
checkTables("shouldInsertViolations", "rule_failures");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldCopyPermanentIdFromPastViolation() {
|
||||
RuleFailureModel pastViolation = getSession().getSingleResult(RuleFailureModel.class, "id", 1);
|
||||
|
||||
Violation violation = Violation.create(rule1, javaFile).setSeverity(RulePriority.MAJOR).setMessage("new message");
|
||||
violationPersister.saveViolation(project, violation, pastViolation, "line_checksum");
|
||||
|
||||
checkTables("shouldCopyPermanentIdFromPastViolation", "rule_failures");
|
||||
}
|
||||
}
|
||||
|
@ -19,6 +19,6 @@
|
||||
scope="FIL" qualifier="CLA" created_at="2008-11-01 13:58:00.00" version="[null]" path=""
|
||||
status="U" islast="false" depth="3" />
|
||||
|
||||
<RULE_FAILURES ID="1" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]" created_at="2008-11-01 13:58:00.00" />
|
||||
<RULE_FAILURES ID="2" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]" created_at="2008-11-01 13:58:00.00" />
|
||||
<rule_failures permanent_id="[null]" ID="1" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]" created_at="2008-11-01 13:58:00.00" />
|
||||
<rule_failures permanent_id="[null]" ID="2" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]" created_at="2008-11-01 13:58:00.00" />
|
||||
</dataset>
|
||||
|
@ -19,6 +19,6 @@
|
||||
scope="FIL" qualifier="CLA" created_at="2008-11-01 13:58:00.00" version="[null]" path=""
|
||||
status="U" islast="false" depth="3" />
|
||||
|
||||
<RULE_FAILURES ID="1" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="2" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="1" ID="1" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="2" ID="2" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
|
||||
</dataset>
|
||||
|
@ -0,0 +1,26 @@
|
||||
<dataset>
|
||||
|
||||
<rules_categories id="1" name="Efficiency" description="[null]"/>
|
||||
<rules_categories id="6" name="Usability" description="[null]"/>
|
||||
|
||||
<rules id="30" name="Check Header" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"
|
||||
plugin_config_key="Checker/Treewalker/HeaderCheck" plugin_name="checkstyle" description="[null]" priority="4" enabled="true"
|
||||
cardinality="SINGLE" parent_id="[null]"/>
|
||||
|
||||
<rules id="31" name="Equals Avoid Null" plugin_rule_key="com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck"
|
||||
plugin_config_key="Checker/TreeWalker/EqualsAvoidNull" plugin_name="checkstyle" description="[null]" priority="4" enabled="true"
|
||||
cardinality="SINGLE" parent_id="[null]"/>
|
||||
|
||||
<projects id="200" scope="FIL" qualifier="CLA" kee="project:org.foo.Bar" root_id="[null]"
|
||||
name="Bar" long_name="org.foo.Bar" description="[null]"
|
||||
enabled="true" language="java" copy_resource_id="[null]" profile_id="[null]"/>
|
||||
|
||||
<snapshots period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]" period3_param="[null]" period3_date="[null]" period4_mode="[null]" period4_param="[null]" period4_date="[null]" period5_mode="[null]" period5_param="[null]" period5_date="[null]" id="1000" project_id="200" parent_snapshot_id="[null]" root_project_id="100" root_snapshot_id="[null]"
|
||||
scope="FIL" qualifier="CLA" created_at="2008-11-01 13:58:00.00" version="[null]" path=""
|
||||
status="U" islast="false" depth="3" />
|
||||
|
||||
<rule_failures permanent_id="1" ID="1" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="2" ID="2" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
|
||||
|
||||
<rule_failures permanent_id="1" ID="3" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="2" MESSAGE="new message" LINE="[null]" COST="[null]" created_at="2008-11-01 13:58:00.00" checksum="line_checksum"/>
|
||||
</dataset>
|
@ -18,9 +18,9 @@
|
||||
scope="FIL" qualifier="CLA" created_at="2008-11-01 13:58:00.00" version="[null]" path=""
|
||||
status="U" islast="false" depth="3" />
|
||||
|
||||
<RULE_FAILURES ID="1" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="2" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="3" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="the message" LINE="20" COST="55.6" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="4" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="[null]" LINE="50" COST="80" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
|
||||
<RULE_FAILURES ID="5" SNAPSHOT_ID="1000" RULE_ID="31" FAILURE_LEVEL="1" MESSAGE="[null]" LINE="[null]" COST="[null]" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="1" ID="1" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="2" ID="2" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="old message" LINE="10" COST="[null]" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="3" ID="3" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="the message" LINE="20" COST="55.6" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="4" ID="4" SNAPSHOT_ID="1000" RULE_ID="30" FAILURE_LEVEL="3" MESSAGE="[null]" LINE="50" COST="80" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
|
||||
<rule_failures permanent_id="5" ID="5" SNAPSHOT_ID="1000" RULE_ID="31" FAILURE_LEVEL="1" MESSAGE="[null]" LINE="[null]" COST="[null]" created_at="2008-11-01 13:58:00.00" checksum="[null]"/>
|
||||
</dataset>
|
@ -57,13 +57,13 @@
|
||||
<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" 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 permanent_id="[null]" ID="1" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" COST="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="2" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" COST="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="3" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" COST="[null]"/>
|
||||
<rule_failures permanent_id="[null]" 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" COST="[null]"/>
|
||||
<RULE_FAILURES ID="6" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg6" COST="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg5" COST="[null]"/>
|
||||
<rule_failures permanent_id="[null]" 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]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
|
||||
|
@ -58,13 +58,13 @@
|
||||
<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" 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 permanent_id="[null]" ID="1" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg1" COST="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="2" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg2" COST="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="3" SNAPSHOT_ID="4" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg3" COST="[null]"/>
|
||||
<rule_failures permanent_id="[null]" 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" COST="[null]"/>
|
||||
<RULE_FAILURES ID="6" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg6" COST="[null]"/>
|
||||
<rule_failures permanent_id="[null]" ID="5" SNAPSHOT_ID="5" RULE_ID="1" FAILURE_LEVEL="2" MESSAGE="msg5" COST="[null]"/>
|
||||
<rule_failures permanent_id="[null]" 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]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
|
||||
|
@ -31,7 +31,7 @@ import javax.persistence.*;
|
||||
public class SchemaMigration {
|
||||
|
||||
public final static int VERSION_UNKNOWN = -1;
|
||||
public static final int LAST_VERSION = 181;
|
||||
public static final int LAST_VERSION = 190;
|
||||
|
||||
public final static String TABLE_NAME = "schema_migrations";
|
||||
|
||||
|
@ -62,6 +62,9 @@ public class RuleFailureModel extends BaseIdentifiable {
|
||||
@Column(name = "checksum", updatable = true, nullable = true, length = 1000)
|
||||
private String checksum;
|
||||
|
||||
@Column(name = "permanent_id", updatable = true, nullable = true)
|
||||
private Integer permanentId;
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
@ -147,6 +150,15 @@ public class RuleFailureModel extends BaseIdentifiable {
|
||||
this.checksum = checksum;
|
||||
}
|
||||
|
||||
public Integer getPermanentId() {
|
||||
return permanentId;
|
||||
}
|
||||
|
||||
public RuleFailureModel setPermanentId(Integer i) {
|
||||
this.permanentId = i;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof RuleFailureModel)) {
|
||||
|
@ -0,0 +1,32 @@
|
||||
#
|
||||
# Sonar, entreprise quality control tool.
|
||||
# Copyright (C) 2008-2011 SonarSource
|
||||
# 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
|
||||
#
|
||||
|
||||
#
|
||||
# Sonar 2.8
|
||||
#
|
||||
class AddRuleFailuresPermanentId < ActiveRecord::Migration
|
||||
|
||||
def self.up
|
||||
add_column 'rule_failures', 'permanent_id', :integer, :null => true
|
||||
add_index 'rule_failures', 'permanent_id', :name => 'rf_permanent_id'
|
||||
RuleFailure.reset_column_information
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user