aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch-protocol/src/main/protobuf
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2015-03-26 17:36:21 +0100
committerJulien HENRY <julien.henry@sonarsource.com>2015-03-26 17:43:06 +0100
commita3bf358944e6245fbf8c69da6a786f4a4620b8a7 (patch)
tree3d7188085d59b6f897ac447baa945e9bcc7948a4 /sonar-batch-protocol/src/main/protobuf
parentc14dc04fddfd11aba13806cc9965f86365079a0a (diff)
downloadsonarqube-a3bf358944e6245fbf8c69da6a786f4a4620b8a7.tar.gz
sonarqube-a3bf358944e6245fbf8c69da6a786f4a4620b8a7.zip
SONAR-6280 Use a range to represent duplication position
Diffstat (limited to 'sonar-batch-protocol/src/main/protobuf')
-rw-r--r--sonar-batch-protocol/src/main/protobuf/batch_report.proto26
1 files changed, 15 insertions, 11 deletions
diff --git a/sonar-batch-protocol/src/main/protobuf/batch_report.proto b/sonar-batch-protocol/src/main/protobuf/batch_report.proto
index a75091b240b..29673bdadd2 100644
--- a/sonar-batch-protocol/src/main/protobuf/batch_report.proto
+++ b/sonar-batch-protocol/src/main/protobuf/batch_report.proto
@@ -168,20 +168,19 @@ message Scm {
}
}
-
-message DuplicationBlock {
- // Will be null on original blocks or when duplications are on the same file
- optional int32 other_component_ref = 1;
- optional int32 start_line = 2;
- optional int32 end_line = 3;
+message Duplicate {
+ // Will be null when duplicate is in the same file
+ optional int32 other_file_ref = 1;
+ optional Range range = 2;
// temporary field during development of computation stack for cross project duplications
- optional string component_key = 4;
+ optional string other_file_key = 3;
}
message Duplication {
- optional DuplicationBlock origin_block = 1;
- repeated DuplicationBlock duplicated_by = 2;
+ // Origin position in current file
+ optional Range origin_position = 1;
+ repeated Duplicate duplicate = 2;
}
message Duplications {
@@ -189,15 +188,20 @@ message Duplications {
repeated Duplication duplication = 2;
}
+// Lines start at 1 and line offsets start at 0
message Range {
+ // Should never be null
optional int32 start_line = 1;
+ // End line (inclusive). Null means it is same as start line
optional int32 end_line = 2;
+ // If null it means range starts at the first offset of start line
optional int32 start_offset = 3;
+ // If null it means range ends at the last offset of end line
optional int32 end_offset = 4;
}
message Symbols {
- optional int32 component_ref = 1;
+ optional int32 file_ref = 1;
repeated Symbol symbol = 2;
message Symbol {
@@ -207,7 +211,7 @@ message Symbols {
}
message SyntaxHighlighting {
- optional int32 component_ref = 1;
+ optional int32 file_ref = 1;
// Rule must be sorted by line and start offset
repeated HighlightingRule highlighting_rule = 2;