aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src
diff options
context:
space:
mode:
authorStas Vilchik <stas.vilchik@sonarsource.com>2018-10-16 17:49:53 +0200
committerSonarTech <sonartech@sonarsource.com>2018-11-07 20:21:02 +0100
commit7168904610eb499afe8a3721c26e7e5afd384725 (patch)
tree9d4ad46c3b33df6ed44a4b1dc6db6fc6f6a8d2f6 /server/sonar-web/src
parentfa1f0457572f5cc3bede3d9c575feb925f2cac8a (diff)
downloadsonarqube-7168904610eb499afe8a3721c26e7e5afd384725.tar.gz
sonarqube-7168904610eb499afe8a3721c26e7e5afd384725.zip
SONAR-11363 Display duplications on the code page
Diffstat (limited to 'server/sonar-web/src')
-rw-r--r--server/sonar-web/src/main/js/apps/code/components/ComponentsHeader.tsx7
-rw-r--r--server/sonar-web/src/main/js/apps/code/components/__tests__/__snapshots__/Components-test.tsx.snap1
-rw-r--r--server/sonar-web/src/main/js/apps/code/utils.ts9
3 files changed, 15 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/apps/code/components/ComponentsHeader.tsx b/server/sonar-web/src/main/js/apps/code/components/ComponentsHeader.tsx
index 651de5704f0..04360721e2d 100644
--- a/server/sonar-web/src/main/js/apps/code/components/ComponentsHeader.tsx
+++ b/server/sonar-web/src/main/js/apps/code/components/ComponentsHeader.tsx
@@ -29,7 +29,12 @@ interface Props {
rootComponent: ComponentMeasure;
}
-const SHORT_NAME_METRICS = ['duplicated_lines_density', 'new_lines', 'new_coverage'];
+const SHORT_NAME_METRICS = [
+ 'duplicated_lines_density',
+ 'new_lines',
+ 'new_coverage',
+ 'new_duplicated_lines_density'
+];
export default function ComponentsHeader({ baseComponent, isLeak, metrics, rootComponent }: Props) {
const isPortfolio = ['VW', 'SVW'].includes(rootComponent.qualifier);
diff --git a/server/sonar-web/src/main/js/apps/code/components/__tests__/__snapshots__/Components-test.tsx.snap b/server/sonar-web/src/main/js/apps/code/components/__tests__/__snapshots__/Components-test.tsx.snap
index e7ad4a769a4..574a4d74e20 100644
--- a/server/sonar-web/src/main/js/apps/code/components/__tests__/__snapshots__/Components-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/code/components/__tests__/__snapshots__/Components-test.tsx.snap
@@ -194,6 +194,7 @@ exports[`renders correctly for leak 1`] = `
"vulnerabilities",
"code_smells",
"new_coverage",
+ "new_duplicated_lines_density",
]
}
rootComponent={
diff --git a/server/sonar-web/src/main/js/apps/code/utils.ts b/server/sonar-web/src/main/js/apps/code/utils.ts
index 820ee070269..cb2d2045cf3 100644
--- a/server/sonar-web/src/main/js/apps/code/utils.ts
+++ b/server/sonar-web/src/main/js/apps/code/utils.ts
@@ -49,7 +49,14 @@ const PORTFOLIO_METRICS = [
'ncloc'
];
-const LEAK_METRICS = ['new_lines', 'bugs', 'vulnerabilities', 'code_smells', 'new_coverage'];
+const LEAK_METRICS = [
+ 'new_lines',
+ 'bugs',
+ 'vulnerabilities',
+ 'code_smells',
+ 'new_coverage',
+ 'new_duplicated_lines_density'
+];
const PAGE_SIZE = 100;