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.3KB

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