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.

constants.ts 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2022 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. import { colors } from '../app/theme';
  21. import { AlmKeys } from '../types/alm-settings';
  22. import { ComponentQualifier } from '../types/component';
  23. import { IssueScope, IssueType } from '../types/issues';
  24. import { RuleType } from '../types/types';
  25. export const SEVERITIES = ['BLOCKER', 'CRITICAL', 'MAJOR', 'MINOR', 'INFO'];
  26. export const STATUSES = ['OPEN', 'REOPENED', 'CONFIRMED', 'RESOLVED', 'CLOSED'];
  27. export const ISSUE_TYPES: IssueType[] = [
  28. IssueType.Bug,
  29. IssueType.Vulnerability,
  30. IssueType.CodeSmell,
  31. IssueType.SecurityHotspot
  32. ];
  33. export const SOURCE_SCOPES = [
  34. { scope: IssueScope.Main, qualifier: ComponentQualifier.File },
  35. { scope: IssueScope.Test, qualifier: ComponentQualifier.TestFile }
  36. ];
  37. export const RULE_TYPES: RuleType[] = ['BUG', 'VULNERABILITY', 'CODE_SMELL', 'SECURITY_HOTSPOT'];
  38. export const RULE_STATUSES = ['READY', 'BETA', 'DEPRECATED'];
  39. export const CHART_COLORS_RANGE_PERCENT = [
  40. colors.green,
  41. colors.lightGreen,
  42. colors.yellow,
  43. colors.orange,
  44. colors.red
  45. ];
  46. export const CHART_REVERSED_COLORS_RANGE_PERCENT = [
  47. colors.red,
  48. colors.orange,
  49. colors.yellow,
  50. colors.lightGreen,
  51. colors.green
  52. ];
  53. export const RATING_COLORS = [
  54. colors.green,
  55. colors.lightGreen,
  56. colors.yellow,
  57. colors.orange,
  58. colors.red
  59. ];
  60. export const PROJECT_KEY_MAX_LEN = 400;
  61. export const ALM_DOCUMENTATION_PATHS = {
  62. [AlmKeys.Azure]: '/documentation/analysis/azuredevops-integration/',
  63. [AlmKeys.BitbucketServer]: '/documentation/analysis/bitbucket-integration/',
  64. [AlmKeys.BitbucketCloud]: '/documentation/analysis/bitbucket-cloud-integration/',
  65. [AlmKeys.GitHub]: '/documentation/analysis/github-integration/',
  66. [AlmKeys.GitLab]: '/documentation/analysis/gitlab-integration/'
  67. };
  68. export const IMPORT_COMPATIBLE_ALMS = [
  69. AlmKeys.Azure,
  70. AlmKeys.BitbucketServer,
  71. AlmKeys.BitbucketCloud,
  72. AlmKeys.GitHub,
  73. AlmKeys.GitLab
  74. ];
  75. // Count both Bitbuckets as a single ALM.
  76. export const IMPORT_COMPATIBLE_ALM_COUNT = IMPORT_COMPATIBLE_ALMS.filter(
  77. a => a !== AlmKeys.BitbucketCloud
  78. ).length;