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.

MeasureUpdateFormulaFactoryImpl.java 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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. package org.sonar.server.measure.live;
  21. import java.util.List;
  22. import java.util.Optional;
  23. import java.util.OptionalInt;
  24. import java.util.Set;
  25. import java.util.function.BiConsumer;
  26. import org.sonar.api.issue.Issue;
  27. import org.sonar.api.issue.impact.SoftwareQuality;
  28. import org.sonar.api.measures.CoreMetrics;
  29. import org.sonar.api.measures.Metric;
  30. import org.sonar.api.rule.Severity;
  31. import org.sonar.api.rules.RuleType;
  32. import org.sonar.server.measure.ImpactMeasureBuilder;
  33. import org.sonar.server.measure.Rating;
  34. import static java.util.Arrays.asList;
  35. import static org.sonar.api.measures.CoreMetrics.CODE_SMELLS;
  36. import static org.sonar.api.measures.CoreMetrics.NEW_SECURITY_HOTSPOTS_REVIEWED;
  37. import static org.sonar.api.measures.CoreMetrics.NEW_SECURITY_HOTSPOTS_REVIEWED_STATUS;
  38. import static org.sonar.api.measures.CoreMetrics.NEW_SECURITY_HOTSPOTS_TO_REVIEW_STATUS;
  39. import static org.sonar.api.measures.CoreMetrics.SECURITY_HOTSPOTS_REVIEWED;
  40. import static org.sonar.api.measures.CoreMetrics.SECURITY_HOTSPOTS_REVIEWED_STATUS;
  41. import static org.sonar.api.measures.CoreMetrics.SECURITY_HOTSPOTS_TO_REVIEW_STATUS;
  42. import static org.sonar.server.measure.Rating.RATING_BY_SEVERITY;
  43. import static org.sonar.server.security.SecurityReviewRating.computePercent;
  44. import static org.sonar.server.security.SecurityReviewRating.computeRating;
  45. public class MeasureUpdateFormulaFactoryImpl implements MeasureUpdateFormulaFactory {
  46. private static final List<MeasureUpdateFormula> FORMULAS = asList(
  47. new MeasureUpdateFormula(CODE_SMELLS, false, new AddChildren(),
  48. (context, issues) -> context.setValue(issues.countUnresolvedByType(RuleType.CODE_SMELL, false))),
  49. new MeasureUpdateFormula(CoreMetrics.BUGS, false, new AddChildren(),
  50. (context, issues) -> context.setValue(issues.countUnresolvedByType(RuleType.BUG, false))),
  51. new MeasureUpdateFormula(CoreMetrics.VULNERABILITIES, false, new AddChildren(),
  52. (context, issues) -> context.setValue(issues.countUnresolvedByType(RuleType.VULNERABILITY, false))),
  53. new MeasureUpdateFormula(CoreMetrics.SECURITY_HOTSPOTS, false, new AddChildren(),
  54. (context, issues) -> context.setValue(issues.countUnresolvedByType(RuleType.SECURITY_HOTSPOT, false))),
  55. new MeasureUpdateFormula(CoreMetrics.RELIABILITY_ISSUES, false, true, new ImpactAddChildren(),
  56. (context, issues) -> context.setValue(issues.getBySoftwareQuality(SoftwareQuality.RELIABILITY, false))),
  57. new MeasureUpdateFormula(CoreMetrics.MAINTAINABILITY_ISSUES, false, true, new ImpactAddChildren(),
  58. (context, issues) -> context.setValue(issues.getBySoftwareQuality(SoftwareQuality.MAINTAINABILITY, false))),
  59. new MeasureUpdateFormula(CoreMetrics.SECURITY_ISSUES, false, true, new ImpactAddChildren(),
  60. (context, issues) -> context.setValue(issues.getBySoftwareQuality(SoftwareQuality.SECURITY, false))),
  61. new MeasureUpdateFormula(CoreMetrics.NEW_RELIABILITY_ISSUES, true, true, new ImpactAddChildren(),
  62. (context, issues) -> context.setValue(issues.getBySoftwareQuality(SoftwareQuality.RELIABILITY, true))),
  63. new MeasureUpdateFormula(CoreMetrics.NEW_MAINTAINABILITY_ISSUES, true, true, new ImpactAddChildren(),
  64. (context, issues) -> context.setValue(issues.getBySoftwareQuality(SoftwareQuality.MAINTAINABILITY, true))),
  65. new MeasureUpdateFormula(CoreMetrics.NEW_SECURITY_ISSUES, true, true, new ImpactAddChildren(),
  66. (context, issues) -> context.setValue(issues.getBySoftwareQuality(SoftwareQuality.SECURITY, true))),
  67. new MeasureUpdateFormula(CoreMetrics.VIOLATIONS, false, new AddChildren(),
  68. (context, issues) -> context.setValue(issues.countUnresolved(false))),
  69. new MeasureUpdateFormula(CoreMetrics.BLOCKER_VIOLATIONS, false, new AddChildren(),
  70. (context, issues) -> context.setValue(issues.countUnresolvedBySeverity(Severity.BLOCKER, false))),
  71. new MeasureUpdateFormula(CoreMetrics.CRITICAL_VIOLATIONS, false, new AddChildren(),
  72. (context, issues) -> context.setValue(issues.countUnresolvedBySeverity(Severity.CRITICAL, false))),
  73. new MeasureUpdateFormula(CoreMetrics.MAJOR_VIOLATIONS, false, new AddChildren(),
  74. (context, issues) -> context.setValue(issues.countUnresolvedBySeverity(Severity.MAJOR, false))),
  75. new MeasureUpdateFormula(CoreMetrics.MINOR_VIOLATIONS, false, new AddChildren(),
  76. (context, issues) -> context.setValue(issues.countUnresolvedBySeverity(Severity.MINOR, false))),
  77. new MeasureUpdateFormula(CoreMetrics.INFO_VIOLATIONS, false, new AddChildren(),
  78. (context, issues) -> context.setValue(issues.countUnresolvedBySeverity(Severity.INFO, false))),
  79. new MeasureUpdateFormula(CoreMetrics.FALSE_POSITIVE_ISSUES, false, new AddChildren(),
  80. (context, issues) -> context.setValue(issues.countByResolution(Issue.RESOLUTION_FALSE_POSITIVE, false))),
  81. new MeasureUpdateFormula(CoreMetrics.ACCEPTED_ISSUES, false, new AddChildren(),
  82. (context, issues) -> context.setValue(issues.countByResolution(Issue.RESOLUTION_WONT_FIX, false))),
  83. new MeasureUpdateFormula(CoreMetrics.HIGH_IMPACT_ACCEPTED_ISSUES, false, true, new AddChildren(),
  84. (context, issues) -> context.setValue(issues.countHighImpactAccepted(false))),
  85. new MeasureUpdateFormula(CoreMetrics.OPEN_ISSUES, false, new AddChildren(),
  86. (context, issues) -> context.setValue(issues.countByStatus(Issue.STATUS_OPEN, false))),
  87. new MeasureUpdateFormula(CoreMetrics.REOPENED_ISSUES, false, new AddChildren(),
  88. (context, issues) -> context.setValue(issues.countByStatus(Issue.STATUS_REOPENED, false))),
  89. new MeasureUpdateFormula(CoreMetrics.CONFIRMED_ISSUES, false, new AddChildren(),
  90. (context, issues) -> context.setValue(issues.countByStatus(Issue.STATUS_CONFIRMED, false))),
  91. new MeasureUpdateFormula(CoreMetrics.TECHNICAL_DEBT, false, new AddChildren(),
  92. (context, issues) -> context.setValue(issues.sumEffortOfUnresolved(RuleType.CODE_SMELL, false))),
  93. new MeasureUpdateFormula(CoreMetrics.RELIABILITY_REMEDIATION_EFFORT, false, new AddChildren(),
  94. (context, issues) -> context.setValue(issues.sumEffortOfUnresolved(RuleType.BUG, false))),
  95. new MeasureUpdateFormula(CoreMetrics.SECURITY_REMEDIATION_EFFORT, false, new AddChildren(),
  96. (context, issues) -> context.setValue(issues.sumEffortOfUnresolved(RuleType.VULNERABILITY, false))),
  97. new MeasureUpdateFormula(CoreMetrics.SQALE_DEBT_RATIO, false, false,
  98. (context, formula) -> context.setValue(100.0 * debtDensity(context)),
  99. (context, issues) -> context.setValue(100.0 * debtDensity(context)),
  100. asList(CoreMetrics.TECHNICAL_DEBT, CoreMetrics.DEVELOPMENT_COST)),
  101. new MeasureUpdateFormula(CoreMetrics.SQALE_RATING, false, false,
  102. (context, issues) -> context.setValue(context.getDebtRatingGrid().getRatingForDensity(debtDensity(context))),
  103. (context, issues) -> context.setValue(context.getDebtRatingGrid().getRatingForDensity(debtDensity(context))),
  104. asList(CoreMetrics.TECHNICAL_DEBT, CoreMetrics.DEVELOPMENT_COST)),
  105. new MeasureUpdateFormula(CoreMetrics.EFFORT_TO_REACH_MAINTAINABILITY_RATING_A, false, false,
  106. (context, formula) -> context.setValue(effortToReachMaintainabilityRatingA(context)),
  107. (context, issues) -> context.setValue(effortToReachMaintainabilityRatingA(context)), asList(CoreMetrics.TECHNICAL_DEBT, CoreMetrics.DEVELOPMENT_COST)),
  108. new MeasureUpdateFormula(CoreMetrics.RELIABILITY_RATING, false, new MaxRatingChildren(),
  109. (context, issues) -> context.setValue(RATING_BY_SEVERITY.get(issues.getHighestSeverityOfUnresolved(RuleType.BUG, false).orElse(Severity.INFO)))),
  110. new MeasureUpdateFormula(CoreMetrics.SECURITY_RATING, false, new MaxRatingChildren(),
  111. (context, issues) -> context.setValue(RATING_BY_SEVERITY.get(issues.getHighestSeverityOfUnresolved(RuleType.VULNERABILITY, false).orElse(Severity.INFO)))),
  112. new MeasureUpdateFormula(SECURITY_HOTSPOTS_REVIEWED_STATUS, false,
  113. (context, formula) -> context.setValue(context.getValue(SECURITY_HOTSPOTS_REVIEWED_STATUS).orElse(0D) + context.getChildrenHotspotsReviewed()),
  114. (context, issues) -> context.setValue(issues.countHotspotsByStatus(Issue.STATUS_REVIEWED, false))),
  115. new MeasureUpdateFormula(SECURITY_HOTSPOTS_TO_REVIEW_STATUS, false,
  116. (context, formula) -> context.setValue(context.getValue(SECURITY_HOTSPOTS_TO_REVIEW_STATUS).orElse(0D) + context.getChildrenHotspotsToReview()),
  117. (context, issues) -> context.setValue(issues.countHotspotsByStatus(Issue.STATUS_TO_REVIEW, false))),
  118. new MeasureUpdateFormula(CoreMetrics.SECURITY_HOTSPOTS_REVIEWED, false,
  119. (context, formula) -> {
  120. Optional<Double> percent = computePercent(
  121. context.getValue(SECURITY_HOTSPOTS_TO_REVIEW_STATUS).orElse(0D).longValue(),
  122. context.getValue(SECURITY_HOTSPOTS_REVIEWED_STATUS).orElse(0D).longValue());
  123. percent.ifPresent(context::setValue);
  124. },
  125. (context, issues) -> computePercent(issues.countHotspotsByStatus(Issue.STATUS_TO_REVIEW, false), issues.countHotspotsByStatus(Issue.STATUS_REVIEWED, false))
  126. .ifPresent(context::setValue)),
  127. new MeasureUpdateFormula(CoreMetrics.SECURITY_REVIEW_RATING, false,
  128. (context, formula) -> context.setValue(computeRating(context.getValue(SECURITY_HOTSPOTS_REVIEWED).orElse(null))),
  129. (context, issues) -> {
  130. Optional<Double> percent = computePercent(issues.countHotspotsByStatus(Issue.STATUS_TO_REVIEW, false), issues.countHotspotsByStatus(Issue.STATUS_REVIEWED, false));
  131. context.setValue(computeRating(percent.orElse(null)));
  132. }),
  133. new MeasureUpdateFormula(CoreMetrics.NEW_CODE_SMELLS, true, new AddChildren(),
  134. (context, issues) -> context.setValue(issues.countUnresolvedByType(RuleType.CODE_SMELL, true))),
  135. new MeasureUpdateFormula(CoreMetrics.NEW_BUGS, true, new AddChildren(),
  136. (context, issues) -> context.setValue(issues.countUnresolvedByType(RuleType.BUG, true))),
  137. new MeasureUpdateFormula(CoreMetrics.NEW_VULNERABILITIES, true, new AddChildren(),
  138. (context, issues) -> context.setValue(issues.countUnresolvedByType(RuleType.VULNERABILITY, true))),
  139. new MeasureUpdateFormula(CoreMetrics.NEW_SECURITY_HOTSPOTS, true, new AddChildren(),
  140. (context, issues) -> context.setValue(issues.countUnresolvedByType(RuleType.SECURITY_HOTSPOT, true))),
  141. new MeasureUpdateFormula(CoreMetrics.NEW_VIOLATIONS, true, new AddChildren(),
  142. (context, issues) -> context.setValue(issues.countUnresolved(true))),
  143. new MeasureUpdateFormula(CoreMetrics.NEW_BLOCKER_VIOLATIONS, true, new AddChildren(),
  144. (context, issues) -> context.setValue(issues.countUnresolvedBySeverity(Severity.BLOCKER, true))),
  145. new MeasureUpdateFormula(CoreMetrics.NEW_CRITICAL_VIOLATIONS, true, new AddChildren(),
  146. (context, issues) -> context.setValue(issues.countUnresolvedBySeverity(Severity.CRITICAL, true))),
  147. new MeasureUpdateFormula(CoreMetrics.NEW_MAJOR_VIOLATIONS, true, new AddChildren(),
  148. (context, issues) -> context.setValue(issues.countUnresolvedBySeverity(Severity.MAJOR, true))),
  149. new MeasureUpdateFormula(CoreMetrics.NEW_MINOR_VIOLATIONS, true, new AddChildren(),
  150. (context, issues) -> context.setValue(issues.countUnresolvedBySeverity(Severity.MINOR, true))),
  151. new MeasureUpdateFormula(CoreMetrics.NEW_INFO_VIOLATIONS, true, new AddChildren(),
  152. (context, issues) -> context.setValue(issues.countUnresolvedBySeverity(Severity.INFO, true))),
  153. new MeasureUpdateFormula(CoreMetrics.NEW_ACCEPTED_ISSUES, true, true, new AddChildren(),
  154. (context, issues) -> context.setValue(issues.countByResolution(Issue.RESOLUTION_WONT_FIX, true))),
  155. new MeasureUpdateFormula(CoreMetrics.NEW_TECHNICAL_DEBT, true, new AddChildren(),
  156. (context, issues) -> context.setValue(issues.sumEffortOfUnresolved(RuleType.CODE_SMELL, true))),
  157. new MeasureUpdateFormula(CoreMetrics.NEW_RELIABILITY_REMEDIATION_EFFORT, true, new AddChildren(),
  158. (context, issues) -> context.setValue(issues.sumEffortOfUnresolved(RuleType.BUG, true))),
  159. new MeasureUpdateFormula(CoreMetrics.NEW_SECURITY_REMEDIATION_EFFORT, true, new AddChildren(),
  160. (context, issues) -> context.setValue(issues.sumEffortOfUnresolved(RuleType.VULNERABILITY, true))),
  161. new MeasureUpdateFormula(CoreMetrics.NEW_RELIABILITY_RATING, true, new MaxRatingChildren(),
  162. (context, issues) -> {
  163. String highestSeverity = issues.getHighestSeverityOfUnresolved(RuleType.BUG, true).orElse(Severity.INFO);
  164. context.setValue(RATING_BY_SEVERITY.get(highestSeverity));
  165. }),
  166. new MeasureUpdateFormula(CoreMetrics.NEW_SECURITY_RATING, true, new MaxRatingChildren(),
  167. (context, issues) -> {
  168. String highestSeverity = issues.getHighestSeverityOfUnresolved(RuleType.VULNERABILITY, true).orElse(Severity.INFO);
  169. context.setValue(RATING_BY_SEVERITY.get(highestSeverity));
  170. }),
  171. new MeasureUpdateFormula(NEW_SECURITY_HOTSPOTS_REVIEWED_STATUS, true,
  172. (context, formula) -> context.setValue(context.getValue(NEW_SECURITY_HOTSPOTS_REVIEWED_STATUS).orElse(0D) + context.getChildrenNewHotspotsReviewed()),
  173. (context, issues) -> context.setValue(issues.countHotspotsByStatus(Issue.STATUS_REVIEWED, true))),
  174. new MeasureUpdateFormula(NEW_SECURITY_HOTSPOTS_TO_REVIEW_STATUS, true,
  175. (context, formula) -> context.setValue(context.getValue(NEW_SECURITY_HOTSPOTS_TO_REVIEW_STATUS).orElse(0D) + context.getChildrenNewHotspotsToReview()),
  176. (context, issues) -> context.setValue(issues.countHotspotsByStatus(Issue.STATUS_TO_REVIEW, true))),
  177. new MeasureUpdateFormula(NEW_SECURITY_HOTSPOTS_REVIEWED, true,
  178. (context, formula) -> {
  179. Optional<Double> percent = computePercent(
  180. context.getValue(NEW_SECURITY_HOTSPOTS_TO_REVIEW_STATUS).orElse(0D).longValue(),
  181. context.getValue(NEW_SECURITY_HOTSPOTS_REVIEWED_STATUS).orElse(0D).longValue());
  182. percent.ifPresent(context::setValue);
  183. },
  184. (context, issues) -> computePercent(issues.countHotspotsByStatus(Issue.STATUS_TO_REVIEW, true), issues.countHotspotsByStatus(Issue.STATUS_REVIEWED, true))
  185. .ifPresent(context::setValue)),
  186. new MeasureUpdateFormula(CoreMetrics.NEW_SECURITY_REVIEW_RATING, true,
  187. (context, formula) -> context.setValue(computeRating(context.getValue(NEW_SECURITY_HOTSPOTS_REVIEWED).orElse(null))),
  188. (context, issues) -> {
  189. Optional<Double> percent = computePercent(issues.countHotspotsByStatus(Issue.STATUS_TO_REVIEW, true), issues.countHotspotsByStatus(Issue.STATUS_REVIEWED, true));
  190. context.setValue(computeRating(percent.orElse(null)));
  191. }),
  192. new MeasureUpdateFormula(CoreMetrics.NEW_SQALE_DEBT_RATIO, true, false,
  193. (context, formula) -> context.setValue(100.0D * newDebtDensity(context)),
  194. (context, issues) -> context.setValue(100.0D * newDebtDensity(context)),
  195. asList(CoreMetrics.NEW_TECHNICAL_DEBT, CoreMetrics.NEW_DEVELOPMENT_COST)),
  196. new MeasureUpdateFormula(CoreMetrics.NEW_MAINTAINABILITY_RATING, true, false,
  197. (context, formula) -> context.setValue(context.getDebtRatingGrid().getRatingForDensity(newDebtDensity(context))),
  198. (context, issues) -> context.setValue(context.getDebtRatingGrid().getRatingForDensity(newDebtDensity(context))),
  199. asList(CoreMetrics.NEW_TECHNICAL_DEBT, CoreMetrics.NEW_DEVELOPMENT_COST)));
  200. private static final Set<Metric> FORMULA_METRICS = MeasureUpdateFormulaFactory.extractMetrics(FORMULAS);
  201. private static double debtDensity(MeasureUpdateFormula.Context context) {
  202. double debt = Math.max(context.getValue(CoreMetrics.TECHNICAL_DEBT).orElse(0.0D), 0.0D);
  203. Optional<Double> devCost = context.getText(CoreMetrics.DEVELOPMENT_COST).map(Double::parseDouble);
  204. if (devCost.isPresent() && Double.doubleToRawLongBits(devCost.get()) > 0L) {
  205. return debt / devCost.get();
  206. }
  207. return 0.0D;
  208. }
  209. private static double newDebtDensity(MeasureUpdateFormula.Context context) {
  210. double debt = Math.max(context.getValue(CoreMetrics.NEW_TECHNICAL_DEBT).orElse(0.0D), 0.0D);
  211. Optional<Double> devCost = context.getValue(CoreMetrics.NEW_DEVELOPMENT_COST);
  212. if (devCost.isPresent() && Double.doubleToRawLongBits(devCost.get()) > 0L) {
  213. return debt / devCost.get();
  214. }
  215. return 0.0D;
  216. }
  217. private static double effortToReachMaintainabilityRatingA(MeasureUpdateFormula.Context context) {
  218. double developmentCost = context.getText(CoreMetrics.DEVELOPMENT_COST).map(Double::parseDouble).orElse(0.0D);
  219. double effort = context.getValue(CoreMetrics.TECHNICAL_DEBT).orElse(0.0D);
  220. double upperGradeCost = context.getDebtRatingGrid().getGradeLowerBound(Rating.B) * developmentCost;
  221. return upperGradeCost < effort ? (effort - upperGradeCost) : 0.0D;
  222. }
  223. static class AddChildren implements BiConsumer<MeasureUpdateFormula.Context, MeasureUpdateFormula> {
  224. @Override
  225. public void accept(MeasureUpdateFormula.Context context, MeasureUpdateFormula formula) {
  226. double sum = context.getChildrenValues().stream().mapToDouble(x -> x).sum();
  227. context.setValue(context.getValue(formula.getMetric()).orElse(0D) + sum);
  228. }
  229. }
  230. private static class MaxRatingChildren implements BiConsumer<MeasureUpdateFormula.Context, MeasureUpdateFormula> {
  231. @Override
  232. public void accept(MeasureUpdateFormula.Context context, MeasureUpdateFormula formula) {
  233. OptionalInt max = context.getChildrenValues().stream().mapToInt(Double::intValue).max();
  234. if (max.isPresent()) {
  235. int currentRating = context.getValue(formula.getMetric()).map(Double::intValue).orElse(Rating.A.getIndex());
  236. context.setValue(Rating.valueOf(Math.max(currentRating, max.getAsInt())));
  237. }
  238. }
  239. }
  240. private static class ImpactAddChildren implements BiConsumer<MeasureUpdateFormula.Context, MeasureUpdateFormula> {
  241. @Override
  242. public void accept(MeasureUpdateFormula.Context context, MeasureUpdateFormula formula) {
  243. ImpactMeasureBuilder impactMeasureBuilder = ImpactMeasureBuilder.createEmpty();
  244. context.getChildrenTextValues().stream()
  245. .map(ImpactMeasureBuilder::fromString)
  246. .forEach(impactMeasureBuilder::add);
  247. context.getText(formula.getMetric()).ifPresent(value -> impactMeasureBuilder.add(ImpactMeasureBuilder.fromString(value)));
  248. context.setValue(impactMeasureBuilder.buildAsString());
  249. }
  250. }
  251. @Override
  252. public List<MeasureUpdateFormula> getFormulas() {
  253. return FORMULAS;
  254. }
  255. @Override
  256. public Set<Metric> getFormulaMetrics() {
  257. return FORMULA_METRICS;
  258. }
  259. }