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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2024 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 { MetricKey } from '../../../types/metrics';
  21. interface Domains {
  22. [domain: string]: { categories?: string[]; order: string[] };
  23. }
  24. const NEW_CODE_CATEGORY = 'new_code_category';
  25. const OVERALL_CATEGORY = 'overall_category';
  26. export const domains: Domains = {
  27. Reliability: {
  28. categories: [NEW_CODE_CATEGORY, OVERALL_CATEGORY],
  29. order: [
  30. NEW_CODE_CATEGORY,
  31. MetricKey.new_reliability_issues,
  32. MetricKey.new_bugs,
  33. MetricKey.new_reliability_rating,
  34. MetricKey.new_reliability_remediation_effort,
  35. OVERALL_CATEGORY,
  36. MetricKey.reliability_issues,
  37. MetricKey.bugs,
  38. MetricKey.reliability_rating,
  39. MetricKey.reliability_remediation_effort,
  40. ],
  41. },
  42. Security: {
  43. categories: [NEW_CODE_CATEGORY, OVERALL_CATEGORY],
  44. order: [
  45. NEW_CODE_CATEGORY,
  46. MetricKey.new_security_issues,
  47. MetricKey.new_vulnerabilities,
  48. MetricKey.new_security_rating,
  49. MetricKey.new_security_remediation_effort,
  50. OVERALL_CATEGORY,
  51. MetricKey.security_issues,
  52. MetricKey.vulnerabilities,
  53. MetricKey.security_rating,
  54. MetricKey.security_remediation_effort,
  55. ],
  56. },
  57. SecurityReview: {
  58. categories: [NEW_CODE_CATEGORY, OVERALL_CATEGORY],
  59. order: [
  60. NEW_CODE_CATEGORY,
  61. MetricKey.new_security_hotspots,
  62. MetricKey.new_security_review_rating,
  63. MetricKey.new_security_hotspots_reviewed,
  64. OVERALL_CATEGORY,
  65. MetricKey.security_hotspots,
  66. MetricKey.security_review_rating,
  67. MetricKey.security_hotspots_reviewed,
  68. ],
  69. },
  70. Maintainability: {
  71. categories: [NEW_CODE_CATEGORY, OVERALL_CATEGORY],
  72. order: [
  73. NEW_CODE_CATEGORY,
  74. MetricKey.new_maintainability_issues,
  75. MetricKey.new_code_smells,
  76. MetricKey.new_technical_debt,
  77. MetricKey.new_sqale_debt_ratio,
  78. MetricKey.new_maintainability_rating,
  79. OVERALL_CATEGORY,
  80. MetricKey.maintainability_issues,
  81. MetricKey.code_smells,
  82. MetricKey.sqale_index,
  83. MetricKey.sqale_debt_ratio,
  84. MetricKey.sqale_rating,
  85. MetricKey.effort_to_reach_maintainability_rating_a,
  86. ],
  87. },
  88. Coverage: {
  89. categories: [NEW_CODE_CATEGORY, OVERALL_CATEGORY, 'tests_category'],
  90. order: [
  91. NEW_CODE_CATEGORY,
  92. MetricKey.new_coverage,
  93. MetricKey.new_lines_to_cover,
  94. MetricKey.new_uncovered_lines,
  95. MetricKey.new_line_coverage,
  96. MetricKey.new_conditions_to_cover,
  97. MetricKey.new_uncovered_conditions,
  98. MetricKey.new_branch_coverage,
  99. OVERALL_CATEGORY,
  100. MetricKey.coverage,
  101. MetricKey.lines_to_cover,
  102. MetricKey.uncovered_lines,
  103. MetricKey.line_coverage,
  104. MetricKey.conditions_to_cover,
  105. MetricKey.uncovered_conditions,
  106. MetricKey.branch_coverage,
  107. 'tests_category',
  108. MetricKey.tests,
  109. MetricKey.test_errors,
  110. MetricKey.test_failures,
  111. MetricKey.skipped_tests,
  112. MetricKey.test_success_density,
  113. MetricKey.test_execution_time,
  114. ],
  115. },
  116. Duplications: {
  117. categories: [NEW_CODE_CATEGORY, OVERALL_CATEGORY],
  118. order: [
  119. NEW_CODE_CATEGORY,
  120. MetricKey.new_duplicated_lines_density,
  121. MetricKey.new_duplicated_lines,
  122. MetricKey.new_duplicated_blocks,
  123. OVERALL_CATEGORY,
  124. MetricKey.duplicated_lines_density,
  125. MetricKey.duplicated_lines,
  126. MetricKey.duplicated_blocks,
  127. MetricKey.duplicated_files,
  128. ],
  129. },
  130. Size: {
  131. order: [
  132. MetricKey.new_lines,
  133. MetricKey.ncloc,
  134. MetricKey.lines,
  135. MetricKey.statements,
  136. MetricKey.functions,
  137. MetricKey.classes,
  138. MetricKey.files,
  139. MetricKey.directories,
  140. ],
  141. },
  142. Complexity: {
  143. order: ['complexity', 'function_complexity', 'file_complexity', 'class_complexity'],
  144. },
  145. Releasability: {
  146. order: ['releasability_rating', 'releasability_effort', 'alert_status'],
  147. },
  148. Issues: {
  149. categories: [NEW_CODE_CATEGORY, OVERALL_CATEGORY],
  150. order: [
  151. NEW_CODE_CATEGORY,
  152. MetricKey.new_violations,
  153. MetricKey.new_accepted_issues,
  154. OVERALL_CATEGORY,
  155. MetricKey.violations,
  156. MetricKey.confirmed_issues,
  157. MetricKey.accepted_issues,
  158. MetricKey.false_positive_issues,
  159. ],
  160. },
  161. };