@@ -30,11 +30,11 @@ import { | |||
import { getLocalizedMetricName, translate } from '../../helpers/l10n'; | |||
import { | |||
MEASURES_REDIRECTION, | |||
areLeakCCTMeasuresComputed, | |||
areCCTMeasuresComputed, | |||
areLeakCCTMeasuresComputed, | |||
getCCTMeasureValue, | |||
getDisplayMetrics, | |||
isDiffMetric, | |||
getCCTMeasureValue, | |||
} from '../../helpers/measures'; | |||
import { | |||
cleanQuery, | |||
@@ -74,15 +74,6 @@ export const KNOWN_DOMAINS = [ | |||
'Complexity', | |||
]; | |||
const CCT_METRIC_DOMAIN_MAP: Dict<string> = { | |||
[MetricKey.security_issues]: 'Security', | |||
[MetricKey.new_security_issues]: 'Security', | |||
[MetricKey.reliability_issues]: 'Reliability', | |||
[MetricKey.new_reliability_issues]: 'Reliability', | |||
[MetricKey.maintainability_issues]: 'Maintainability', | |||
[MetricKey.new_maintainability_issues]: 'Maintainability', | |||
}; | |||
const DEPRECATED_METRICS = [ | |||
MetricKey.blocker_violations, | |||
MetricKey.new_blocker_violations, | |||
@@ -118,14 +109,10 @@ export const populateDomainsFromMeasures = memoize((measures: MeasureEnhanced[]) | |||
return { | |||
...measure, | |||
metric: { | |||
...measure.metric, | |||
domain: CCT_METRIC_DOMAIN_MAP[measure.metric.key] ?? measure.metric.domain, | |||
}, | |||
...(!isDiff && { value: calculatedValue }), | |||
...(isDiff && { leak: calculatedValue }), | |||
...{ [isDiff ? 'leak' : 'value']: calculatedValue }, | |||
}; | |||
}); | |||
if (areLeakCCTMeasuresComputed(measures)) { | |||
populatedMeasures = populatedMeasures.filter( | |||
(measure) => !LEAK_OLD_TAXONOMY_METRICS.includes(measure.metric.key as MetricKey), |
@@ -915,6 +915,7 @@ export const DEFAULT_METRICS: Dict<Metric> = { | |||
type: 'DATA', | |||
name: 'Reliability', | |||
description: 'Reliability issues', | |||
domain: 'Reliability', | |||
direction: 0, | |||
qualitative: false, | |||
hidden: false, | |||
@@ -924,6 +925,7 @@ export const DEFAULT_METRICS: Dict<Metric> = { | |||
type: 'DATA', | |||
name: 'New Reliability', | |||
description: 'New Reliability issues', | |||
domain: 'Reliability', | |||
direction: 0, | |||
qualitative: false, | |||
hidden: false, | |||
@@ -1035,6 +1037,7 @@ export const DEFAULT_METRICS: Dict<Metric> = { | |||
type: 'DATA', | |||
name: 'Security', | |||
description: 'Security issues', | |||
domain: 'Security', | |||
direction: 0, | |||
qualitative: false, | |||
hidden: false, | |||
@@ -1044,7 +1047,7 @@ export const DEFAULT_METRICS: Dict<Metric> = { | |||
type: 'DATA', | |||
name: 'Security', | |||
description: 'New Security issues', | |||
domain: 'Issues', | |||
domain: 'Security', | |||
direction: 0, | |||
qualitative: false, | |||
hidden: false, | |||
@@ -1214,7 +1217,7 @@ export const DEFAULT_METRICS: Dict<Metric> = { | |||
type: 'DATA', | |||
name: 'Maintainability', | |||
description: 'Maintainability issues', | |||
domain: 'Issues', | |||
domain: 'Maintainability', | |||
direction: 0, | |||
qualitative: false, | |||
hidden: false, | |||
@@ -1224,7 +1227,7 @@ export const DEFAULT_METRICS: Dict<Metric> = { | |||
type: 'DATA', | |||
name: 'Maintainability', | |||
description: 'New Maintainability issues', | |||
domain: 'Issues', | |||
domain: 'Maintainability', | |||
direction: 0, | |||
qualitative: false, | |||
hidden: false, |