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.

issues.ts 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2021 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. export enum IssueType {
  21. CodeSmell = 'CODE_SMELL',
  22. Vulnerability = 'VULNERABILITY',
  23. Bug = 'BUG',
  24. SecurityHotspot = 'SECURITY_HOTSPOT'
  25. }
  26. export enum IssueScope {
  27. Main = 'MAIN',
  28. Test = 'TEST'
  29. }
  30. interface Comment {
  31. createdAt: string;
  32. htmlText: string;
  33. key: string;
  34. login: string;
  35. markdown: string;
  36. updatable: boolean;
  37. }
  38. export interface RawIssue {
  39. assignee?: string;
  40. author?: string;
  41. comments?: Array<Comment>;
  42. component: string;
  43. flows?: Array<{
  44. // `componentName` is not available in RawIssue
  45. locations?: Array<T.Omit<T.FlowLocation, 'componentName'>>;
  46. }>;
  47. key: string;
  48. line?: number;
  49. project: string;
  50. rule: string;
  51. severity: string;
  52. status: string;
  53. subProject?: string;
  54. textRange?: T.TextRange;
  55. }
  56. export interface IssueResponse {
  57. components?: Array<{ key: string; name: string }>;
  58. issue: RawIssue;
  59. rules?: Array<{}>;
  60. users?: Array<T.UserBase>;
  61. }
  62. export interface RawIssuesResponse {
  63. components: ReferencedComponent[];
  64. effortTotal: number;
  65. facets: RawFacet[];
  66. issues: RawIssue[];
  67. languages: ReferencedLanguage[];
  68. paging: T.Paging;
  69. rules?: Array<{}>;
  70. users?: Array<T.UserBase>;
  71. }
  72. export interface FetchIssuesPromise {
  73. components: ReferencedComponent[];
  74. effortTotal: number;
  75. facets: RawFacet[];
  76. issues: T.Issue[];
  77. languages: ReferencedLanguage[];
  78. paging: T.Paging;
  79. rules: ReferencedRule[];
  80. users: T.UserBase[];
  81. }
  82. export interface ReferencedComponent {
  83. key: string;
  84. name: string;
  85. path?: string;
  86. uuid: string;
  87. }
  88. export interface ReferencedLanguage {
  89. name: string;
  90. }
  91. export interface ReferencedRule {
  92. langName?: string;
  93. name: string;
  94. }
  95. export interface RawFacet {
  96. property: string;
  97. values: Array<{ val: string; count: number }>;
  98. }
  99. export interface Facet {
  100. [value: string]: number;
  101. }