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 5.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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. enum CleanCodeAttribute {
  69. CONVENTIONAL = 0;
  70. FORMATTED = 1;
  71. IDENTIFIABLE = 2;
  72. CLEAR = 3;
  73. COMPLETE = 4;
  74. EFFICIENT = 5;
  75. LOGICAL = 6;
  76. DISTINCT = 7;
  77. FOCUSED = 8;
  78. MODULAR = 9;
  79. TESTED = 10;
  80. LAWFUL = 11;
  81. RESPECTFUL = 12;
  82. TRUSTWORTHY = 13;
  83. }
  84. enum CleanCodeAttributeCategory {
  85. ADAPTABLE = 0;
  86. CONSISTENT = 1;
  87. INTENTIONAL = 2;
  88. RESPONSIBLE = 3;
  89. }
  90. message Impact {
  91. required SoftwareQuality softwareQuality = 1;
  92. required ImpactSeverity severity = 2;
  93. }
  94. enum SoftwareQuality {
  95. MAINTAINABILITY = 0;
  96. RELIABILITY = 1;
  97. SECURITY = 2;
  98. }
  99. enum ImpactSeverity {
  100. LOW = 0;
  101. MEDIUM = 1;
  102. HIGH = 2;
  103. }
  104. // Lines start at 1 and line offsets start at 0
  105. message TextRange {
  106. // Start line. Should never be absent
  107. optional int32 startLine = 1;
  108. // End line (inclusive). Absent means it is same as start line
  109. optional int32 endLine = 2;
  110. // If absent it means range starts at the first offset of start line
  111. optional int32 startOffset = 3;
  112. // If absent it means range ends at the last offset of end line
  113. optional int32 endOffset = 4;
  114. }
  115. message Flow {
  116. repeated Location locations = 1;
  117. optional string description = 2;
  118. optional FlowType type = 3;
  119. }
  120. enum FlowType {
  121. UNDEFINED = 0;
  122. DATA = 1;
  123. EXECUTION = 2;
  124. }
  125. message Location {
  126. optional string component = 4;
  127. optional string unusedComponentId = 1;
  128. // Only when component is a file. Can be empty for a file if this is an issue global to the file.
  129. optional sonarqube.ws.commons.TextRange textRange = 2;
  130. optional string msg = 3;
  131. repeated MessageFormatting msgFormattings = 5;
  132. }
  133. message User {
  134. optional string login = 1;
  135. optional string name = 2;
  136. optional string avatar = 3;
  137. optional bool active = 4;
  138. }
  139. message Changelog {
  140. optional string user = 1;
  141. optional string userName = 2;
  142. // Email is no more returned since 6.3
  143. optional string deprecatedEmail = 3;
  144. optional string creationDate = 4;
  145. repeated Diff diffs = 5;
  146. optional string avatar = 6;
  147. optional bool isUserActive = 7;
  148. optional string externalUser = 8;
  149. optional string webhookSource = 9;
  150. message Diff {
  151. optional string key = 1;
  152. optional string newValue = 2;
  153. optional string oldValue = 3;
  154. }
  155. }
  156. message Comment {
  157. optional string key = 1;
  158. optional string login = 2;
  159. optional string htmlText = 5;
  160. optional string markdown = 6;
  161. optional bool updatable = 7;
  162. optional string createdAt = 8;
  163. }
  164. message Metric {
  165. optional string key = 1;
  166. optional string name = 2;
  167. optional string description = 3;
  168. optional string domain = 4;
  169. optional string type = 5;
  170. optional bool higherValuesAreBetter = 6;
  171. optional bool qualitative = 7;
  172. optional bool hidden = 8;
  173. optional bool custom = 9;
  174. optional int32 decimalScale = 10;
  175. optional string bestValue = 11;
  176. optional string worstValue = 12;
  177. }
  178. enum RuleType {
  179. // Zero is required in order to not get MAINTAINABILITY as default value
  180. // See http://androiddevblog.com/protocol-buffers-pitfall-adding-enum-values/
  181. UNKNOWN = 0;
  182. // same name as in Java enum IssueType,
  183. // same index values as in database (see column ISSUES.ISSUE_TYPE)
  184. CODE_SMELL = 1;
  185. BUG = 2;
  186. VULNERABILITY = 3;
  187. SECURITY_HOTSPOT = 4;
  188. }
  189. enum BranchType {
  190. reserved 1, 2;
  191. UNKNOWN_BRANCH_TYPE = 0;
  192. PULL_REQUEST = 3;
  193. BRANCH = 4;
  194. }
  195. message MessageFormatting {
  196. required int32 start = 1;
  197. required int32 end = 2;
  198. required MessageFormattingType type = 3;
  199. }
  200. enum MessageFormattingType {
  201. CODE = 0;
  202. }