You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ws-commons.proto 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. // SonarQube, open source software quality management tool.
  2. // Copyright (C) 2008-2016 SonarSource
  3. // mailto:contact AT sonarsource DOT com
  4. //
  5. // SonarQube is free software; you can redistribute it and/or
  6. // modify it under the terms of the GNU Lesser General Public
  7. // License as published by the Free Software Foundation; either
  8. // version 3 of the License, or (at your option) any later version.
  9. //
  10. // SonarQube is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. // Lesser General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU Lesser General Public License
  16. // along with this program; if not, write to the Free Software Foundation,
  17. // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. syntax = "proto2";
  19. package sonarqube.ws.commons;
  20. option java_package = "org.sonarqube.ws";
  21. option java_outer_classname = "Common";
  22. option optimize_for = SPEED;
  23. message Paging {
  24. optional int32 pageIndex = 1;
  25. optional int32 pageSize = 2;
  26. optional int32 total = 3;
  27. }
  28. message Facet {
  29. // kind of key
  30. optional string property = 1;
  31. repeated FacetValue values = 2;
  32. }
  33. message Facets {
  34. repeated Facet facets = 1;
  35. }
  36. message FacetValue {
  37. optional string val = 1;
  38. optional int64 count = 2;
  39. }
  40. enum Severity {
  41. INFO = 0;
  42. MINOR = 1;
  43. MAJOR = 2;
  44. CRITICAL = 3;
  45. BLOCKER = 4;
  46. }
  47. message Rule {
  48. optional string key = 1;
  49. optional string name = 2;
  50. optional string lang = 3;
  51. optional RuleStatus status = 4;
  52. optional string langName = 5;
  53. }
  54. message Rules {
  55. repeated Rule rules = 1;
  56. }
  57. enum RuleStatus {
  58. BETA = 0;
  59. DEPRECATED = 1;
  60. READY = 2;
  61. REMOVED = 3;
  62. }
  63. enum RuleScope {
  64. MAIN = 0;
  65. TEST = 1;
  66. ALL = 2;
  67. }
  68. // Lines start at 1 and line offsets start at 0
  69. message TextRange {
  70. // Start line. Should never be absent
  71. optional int32 startLine = 1;
  72. // End line (inclusive). Absent means it is same as start line
  73. optional int32 endLine = 2;
  74. // If absent it means range starts at the first offset of start line
  75. optional int32 startOffset = 3;
  76. // If absent it means range ends at the last offset of end line
  77. optional int32 endOffset = 4;
  78. }
  79. message Metric {
  80. optional string key = 1;
  81. optional string name = 2;
  82. optional string description = 3;
  83. optional string domain = 4;
  84. optional string type = 5;
  85. optional bool higherValuesAreBetter = 6;
  86. optional bool qualitative = 7;
  87. optional bool hidden = 8;
  88. optional bool custom = 9;
  89. optional int32 decimalScale = 10;
  90. optional string bestValue = 11;
  91. optional string worstValue = 12;
  92. }
  93. enum RuleType {
  94. // Zero is required in order to not get MAINTAINABILITY as default value
  95. // See http://androiddevblog.com/protocol-buffers-pitfall-adding-enum-values/
  96. UNKNOWN = 0;
  97. // same name as in Java enum IssueType,
  98. // same index values as in database (see column ISSUES.ISSUE_TYPE)
  99. CODE_SMELL = 1;
  100. BUG = 2;
  101. VULNERABILITY = 3;
  102. SECURITY_HOTSPOT = 4;
  103. }
  104. enum BranchType {
  105. // Zero is required in order to not get LONG as default value
  106. // See http://androiddevblog.com/protocol-buffers-pitfall-adding-enum-values/
  107. UNKNOWN_BRANCH_TYPE = 0;
  108. LONG = 1;
  109. SHORT = 2;
  110. PULL_REQUEST = 3;
  111. }
  112. message Organization {
  113. optional string key = 1;
  114. optional string name = 2;
  115. }