From 711c144b6dad1c6e245d1f86c5978dc9b8335155 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 7 Mar 2016 15:54:05 +0100 Subject: [PATCH] SONAR-7408 Drop "Technical Debt", "Coverage", "Duplications" and "Structure" pages --- .../java/it/measure/ProjectOverviewTest.java | 30 -- .../test_it_coverage_on_project_overview.html | 70 ---- ..._overall_coverage_on_project_overview.html | 90 ------ .../test_ut_coverage_on_project_overview.html | 75 ----- .../src/main/js/apps/overview/app.js | 4 +- .../components/complexity-distribution.js | 12 +- .../components/coverage-measures-list.js | 94 ------ .../overview/components/coverage-measures.js | 172 ---------- .../overview/components/detailed-measure.js | 58 ---- .../components/domain-bubble-chart.js | 177 ----------- .../overview/components/domain-timeline.js | 258 --------------- .../overview/components/domain-treemap.js | 172 ---------- .../apps/overview/components/issue-measure.js | 298 ------------------ .../overview/components/issues-assignees.js | 50 --- .../apps/overview/components/issues-tags.js | 36 --- .../overview/components/ncloc-distribution.js | 122 ------- .../apps/overview/domains/coverage-domain.js | 164 ---------- .../js/apps/overview/domains/debt-domain.js | 253 --------------- .../overview/domains/duplications-domain.js | 213 ------------- .../apps/overview/domains/structure-domain.js | 217 ------------- .../js/apps/overview/gate/gate-condition.js | 16 +- .../js/apps/overview/gate/gate-conditions.js | 2 +- .../main/js/apps/overview/gate/gate-empty.js | 2 +- .../src/main/js/apps/overview/gate/gate.js | 6 +- .../main/js/apps/overview/helpers/metrics.js | 37 --- .../main/js/apps/overview/main/components.js | 31 +- .../main/js/apps/overview/main/coverage.js | 11 +- .../src/main/js/apps/overview/main/debt.js | 5 +- .../js/apps/overview/main/duplications.js | 9 +- .../src/main/js/apps/overview/main/main.js | 22 +- .../main/js/apps/overview/main/structure.js | 7 +- .../main/js/apps/overview/main/timeline.js | 10 +- .../src/main/js/apps/overview/meta.js | 16 +- .../src/main/js/apps/overview/overview.js | 44 +-- .../main/nav/component/component-nav-menu.js | 119 +++---- .../overview/components/issues-tags-test.js | 45 --- .../apps/overview/helpers/metrics-test.js | 110 ------- .../resources/org/sonar/l10n/core.properties | 14 - 38 files changed, 131 insertions(+), 2940 deletions(-) delete mode 100644 it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_it_coverage_on_project_overview.html delete mode 100644 it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_overall_coverage_on_project_overview.html delete mode 100644 it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_ut_coverage_on_project_overview.html delete mode 100644 server/sonar-web/src/main/js/apps/overview/components/coverage-measures-list.js delete mode 100644 server/sonar-web/src/main/js/apps/overview/components/coverage-measures.js delete mode 100644 server/sonar-web/src/main/js/apps/overview/components/detailed-measure.js delete mode 100644 server/sonar-web/src/main/js/apps/overview/components/domain-bubble-chart.js delete mode 100644 server/sonar-web/src/main/js/apps/overview/components/domain-timeline.js delete mode 100644 server/sonar-web/src/main/js/apps/overview/components/domain-treemap.js delete mode 100644 server/sonar-web/src/main/js/apps/overview/components/issue-measure.js delete mode 100644 server/sonar-web/src/main/js/apps/overview/components/issues-assignees.js delete mode 100644 server/sonar-web/src/main/js/apps/overview/components/issues-tags.js delete mode 100644 server/sonar-web/src/main/js/apps/overview/components/ncloc-distribution.js delete mode 100644 server/sonar-web/src/main/js/apps/overview/domains/coverage-domain.js delete mode 100644 server/sonar-web/src/main/js/apps/overview/domains/debt-domain.js delete mode 100644 server/sonar-web/src/main/js/apps/overview/domains/duplications-domain.js delete mode 100644 server/sonar-web/src/main/js/apps/overview/domains/structure-domain.js delete mode 100644 server/sonar-web/tests/apps/overview/components/issues-tags-test.js delete mode 100644 server/sonar-web/tests/apps/overview/helpers/metrics-test.js diff --git a/it/it-tests/src/test/java/it/measure/ProjectOverviewTest.java b/it/it-tests/src/test/java/it/measure/ProjectOverviewTest.java index 069fd101e24..c585f6afbfb 100644 --- a/it/it-tests/src/test/java/it/measure/ProjectOverviewTest.java +++ b/it/it-tests/src/test/java/it/measure/ProjectOverviewTest.java @@ -50,36 +50,6 @@ public class ProjectOverviewTest { new SeleneseTest(selenese).runOn(orchestrator); } - @Test - public void test_ut_coverage_on_project_overview() throws Exception { - executeBuild("testing/xoo-sample-ut-coverage", "project-for-overview-ut-coverage", "Project For Overview UT"); - - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("test_ut_coverage_on_project_overview", - "/measure/ProjectOverviewTest/test_ut_coverage_on_project_overview.html" - ).build(); - new SeleneseTest(selenese).runOn(orchestrator); - } - - @Test - public void test_it_coverage_on_project_overview() throws Exception { - executeBuild("testing/xoo-sample-it-coverage", "project-for-overview-it-coverage", "Project For Overview IT"); - - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("test_it_coverage_onfi_project_overview", - "/measure/ProjectOverviewTest/test_it_coverage_on_project_overview.html" - ).build(); - new SeleneseTest(selenese).runOn(orchestrator); - } - - @Test - public void test_overall_coverage_on_project_overview() throws Exception { - executeBuild("testing/xoo-sample-overall-coverage", "project-for-overview-overall-coverage", "Project For Overview Overall"); - - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("test_overall_coverage_on_project_overview", - "/measure/ProjectOverviewTest/test_overall_coverage_on_project_overview.html" - ).build(); - new SeleneseTest(selenese).runOn(orchestrator); - } - @Test public void should_display_a_nice_error_when_requesting_unknown_project() { Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("should_display_a_nice_error_when_requesting_unknown_project", diff --git a/it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_it_coverage_on_project_overview.html b/it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_it_coverage_on_project_overview.html deleted file mode 100644 index 09d5b93211e..00000000000 --- a/it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_it_coverage_on_project_overview.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - test_project_overview_after_first_analysis - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
test_project_overview_after_first_analysis
open/overview?id=project-for-overview-it-coverage
waitForTextid=content*50.0%*Coverage*
open/overview/coverage?id=project-for-overview-it-coverage
waitForTextid=content*IT coverage*50.0%*
waitForTextid=content*IT line coverage*50.0%*
waitForTextid=content*IT condition coverage*50.0%*
waitForTextid=content*IT uncovered conditions*1*
waitForTextid=content*IT uncovered lines*2*
waitForTextid=content*Size*IT uncovered lines*
waitForTextid=content*Size*Lines of code*Color*IT coverage*
- - diff --git a/it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_overall_coverage_on_project_overview.html b/it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_overall_coverage_on_project_overview.html deleted file mode 100644 index 8ef8b08e055..00000000000 --- a/it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_overall_coverage_on_project_overview.html +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - test_project_overview_after_first_analysis - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
test_project_overview_after_first_analysis
open/overview?id=project-for-overview-overall-coverage
waitForTextid=content*62.5%*Coverage*
open/overview/coverage?id=project-for-overview-overall-coverage
waitForTextid=content*Overall coverage*62.5%*
waitForTextid=content*Overall line coverage*75.0%*
waitForTextid=content*Overall condition coverage*50.0%*
waitForTextid=content*Uncovered conditions*3*
waitForTextid=content*IT uncovered conditions*3*
waitForTextid=content*Overall uncovered conditions*2*
waitForTextid=content*Uncovered lines*2*
waitForTextid=content*IT uncovered lines*2*
waitForTextid=content*Overall uncovered lines*1*
waitForTextid=content*Size*Overall uncovered lines*
waitForTextid=content*Size*Lines of code*Color*Overall coverage*
- - diff --git a/it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_ut_coverage_on_project_overview.html b/it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_ut_coverage_on_project_overview.html deleted file mode 100644 index 158ddb02de3..00000000000 --- a/it/it-tests/src/test/resources/measure/ProjectOverviewTest/test_ut_coverage_on_project_overview.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - test_project_overview_after_first_analysis - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
test_project_overview_after_first_analysis
open/overview?id=project-for-overview-ut-coverage
waitForTextid=content*50.0%*Coverage*
open/overview/coverage?id=project-for-overview-ut-coverage
waitForTextid=content*Coverage*50.0%*
waitForTextid=content*Line coverage*50.0%*
waitForTextid=content*Condition coverage*50.0%*
waitForTextid=content*Lines to cover*4*
waitForTextid=content*Uncovered conditions*1*
waitForTextid=content*Uncovered lines*2*
waitForTextid=content*Size*Uncovered lines*
waitForTextid=content*Size*Lines of code*Color*Coverage*
- - diff --git a/server/sonar-web/src/main/js/apps/overview/app.js b/server/sonar-web/src/main/js/apps/overview/app.js index bc8f6322409..e7b6d020943 100644 --- a/server/sonar-web/src/main/js/apps/overview/app.js +++ b/server/sonar-web/src/main/js/apps/overview/app.js @@ -30,12 +30,12 @@ const LEAK_PERIOD = '1'; class App { start (options) { - let opts = _.extend({}, options, window.sonarqube.overview); + const opts = _.extend({}, options, window.sonarqube.overview); _.extend(opts.component, options.component); opts.urlRoot = '/overview'; $('html').toggleClass('dashboard-page', opts.component.hasSnapshot); - let el = document.querySelector(opts.el); + const el = document.querySelector(opts.el); if (opts.component.hasSnapshot) { ReactDOM.render(, el); diff --git a/server/sonar-web/src/main/js/apps/overview/components/complexity-distribution.js b/server/sonar-web/src/main/js/apps/overview/components/complexity-distribution.js index ada42eafa3a..dc9dc1e7460 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/complexity-distribution.js +++ b/server/sonar-web/src/main/js/apps/overview/components/complexity-distribution.js @@ -34,10 +34,10 @@ export const ComplexityDistribution = React.createClass({ }, renderBarChart () { - let data = this.props.distribution.split(';').map((point, index) => { - let tokens = point.split('='); - let y = parseInt(tokens[1], 10); - let value = parseInt(tokens[0], 10); + const data = this.props.distribution.split(';').map((point, index) => { + const tokens = point.split('='); + const y = parseInt(tokens[1], 10); + const value = parseInt(tokens[0], 10); return { x: index, y, @@ -46,9 +46,9 @@ export const ComplexityDistribution = React.createClass({ }; }); - let xTicks = data.map(point => point.value); + const xTicks = data.map(point => point.value); - let xValues = data.map(point => formatMeasure(point.y, 'INT')); + const xValues = data.map(point => formatMeasure(point.y, 'INT')); return knownMetrics.indexOf(metric.key) === -1) - .map(metric => metric.key); - return this.renderListOfMeasures(metrics); - }, - - renderListOfMeasures(list) { - let metrics = list.map(key => _.findWhere(this.props.metrics, { key })); - - if (_.every(metrics, metric => this.props.measures[metric.key] == null)) { - // if no measures exist - return null; - } - - metrics = metrics.map(metric => { - return ; - }); - return
{metrics}
; - }, - - render () { - return
- {this.shouldRenderOverallCoverage() && } - {this.shouldRenderUTCoverage() && } - {this.shouldRenderITCoverage() && } - {this.renderListOfMeasures(TEST_METRICS)} - {this.renderOtherMeasures()} -
; - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/components/coverage-measures.js b/server/sonar-web/src/main/js/apps/overview/components/coverage-measures.js deleted file mode 100644 index 081d833eeee..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/components/coverage-measures.js +++ /dev/null @@ -1,172 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import React from 'react'; - -import { DetailedMeasure } from './detailed-measure'; -import { DonutChart } from '../../../components/charts/donut-chart'; -import { DrilldownLink } from '../../../components/shared/drilldown-link'; -import { formatMeasure, formatMeasureVariation } from '../../../helpers/measures'; -import { translate } from '../../../helpers/l10n'; - - -export const CoverageMeasures = React.createClass({ - propTypes: { - measures: React.PropTypes.object.isRequired, - leak: React.PropTypes.object.isRequired, - prefix: React.PropTypes.string.isRequired - }, - - getMetricName(metric) { - const { prefix } = this.props; - return prefix + metric; - }, - - getNewCoverageMetricName () { - const { prefix } = this.props; - return 'new_' + prefix + 'coverage'; - }, - - getCoverageMeasure() { - const coverageMetricName = this.getMetricName('coverage'); - return this.props.measures[coverageMetricName]; - }, - - getCoverageLeak() { - const coverageMetricName = this.getMetricName('coverage'); - return this.props.leak[coverageMetricName]; - }, - - getNewCoverageMeasure() { - const newCoverageMetricName = this.getNewCoverageMetricName(); - return this.props.leak[newCoverageMetricName]; - }, - - renderCoverageLeak () { - if (!this.props.leakPeriodDate) { - return null; - } - const coverageLeak = this.getCoverageLeak(); - return
- - {formatMeasureVariation(coverageLeak, 'PERCENT')} - -
; - }, - - renderCoverageOnNewCode() { - const newCoverageMetricName = this.getNewCoverageMetricName(); - const newCoverage = this.getNewCoverageMeasure(); - - if (!this.props.leakPeriodDate || newCoverage == null) { - return null; - } - - const donutData = [ - { value: newCoverage, fill: '#85bb43' }, - { value: 100 - newCoverage, fill: '#d4333f' } - ]; - return
-
- - {translate('metric', newCoverageMetricName, 'name')} - -
- -
- - - - - - {formatMeasure(newCoverage, 'PERCENT')} - - -
-
; - }, - - renderDonut() { - const coverage = this.getCoverageMeasure(); - const donutData = [ - { value: coverage, fill: '#85bb43' }, - { value: 100 - coverage, fill: '#d4333f' } - ]; - return ; - }, - - render() { - const coverageMetricName = this.getMetricName('coverage'); - const coverage = this.getCoverageMeasure(); - - return ( -
-
-
- - {translate('metric', coverageMetricName, 'name')} - - - {this.renderDonut()} - - {formatMeasure(coverage, 'PERCENT')} - - -
- - {this.renderCoverageLeak()} -
- - - - - - - - - - - - - - {this.renderCoverageOnNewCode()} -
- ); - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/components/detailed-measure.js b/server/sonar-web/src/main/js/apps/overview/components/detailed-measure.js deleted file mode 100644 index 8a8e1c9af84..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/components/detailed-measure.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import React from 'react'; - -import { formatMeasure, formatMeasureVariation, localizeMetric } from '../../../helpers/measures'; -import { DrilldownLink } from '../../../components/shared/drilldown-link'; -import { getShortType } from '../helpers/metrics'; - - -export const DetailedMeasure = React.createClass({ - renderLeak () { - if (!this.props.leakPeriodDate) { - return null; - } - let leak = this.props.leak[this.props.metric]; - let formatted = leak != null ? formatMeasureVariation(leak, getShortType(this.props.type)) : '—'; - return
- {formatted} -
; - }, - - render () { - let measure = this.props.measures[this.props.metric]; - if (measure == null) { - return null; - } - - return
-
- {localizeMetric(this.props.metric)} - - - {formatMeasure(measure, this.props.type)} - - - {this.props.children} -
- {this.renderLeak()} -
; - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/components/domain-bubble-chart.js b/server/sonar-web/src/main/js/apps/overview/components/domain-bubble-chart.js deleted file mode 100644 index 92d30f87811..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/components/domain-bubble-chart.js +++ /dev/null @@ -1,177 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import _ from 'underscore'; -import React from 'react'; - -import { BubbleChart } from '../../../components/charts/bubble-chart'; -import { translate, translateWithParameters } from '../../../helpers/l10n'; -import { getFiles } from '../../../api/components'; -import { formatMeasure } from '../../../helpers/measures'; -import Workspace from '../../../components/workspace/main'; - - -const HEIGHT = 360; -const BUBBLES_LIMIT = 500; - - -function getMeasure (component, metric) { - return Number(component.measures[metric]) || 0; -} - - -export class DomainBubbleChart extends React.Component { - constructor (props) { - super(props); - this.state = { - loading: true, - files: [], - xMetric: this.getMetricObject(props.metrics, props.xMetric), - yMetric: this.getMetricObject(props.metrics, props.yMetric), - sizeMetrics: props.sizeMetrics.map(this.getMetricObject.bind(null, props.metrics)) - }; - } - - componentDidMount () { - this.requestFiles(); - } - - requestFiles () { - const metrics = [].concat(this.props.xMetric, this.props.yMetric, this.props.sizeMetrics); - const options = { - s: 'metric', - metricSort: this.props.sizeMetrics, - asc: false, - ps: BUBBLES_LIMIT - }; - return getFiles(this.props.component.key, metrics, options).then(r => { - let files = r.map(file => { - let measures = {}; - (file.measures || []).forEach(measure => { - measures[measure.metric] = measure.value; - }); - return _.extend(file, { measures }); - }); - this.setState({ - loading: false, - files, - total: files.length - }); - }); - } - - getMetricObject (metrics, metricKey) { - return _.findWhere(metrics, { key: metricKey }); - } - - getSizeMetricsValue (component) { - return this.props.sizeMetrics.reduce((previousValue, currentValue) => { - return previousValue + getMeasure(component, currentValue); - }, 0); - } - - getSizeMetricsTitle () { - return this.state.sizeMetrics.map(metric => metric.name).join(' & '); - } - - getTooltip (component) { - let sizeMetricsTitle = this.getSizeMetricsTitle(); - let sizeMetricsType = this.state.sizeMetrics[0].type; - - /* eslint max-len: 0 */ - let inner = [ - component.name, - `${this.state.xMetric.name}: ${formatMeasure(getMeasure(component, this.props.xMetric), - this.state.xMetric.type)}`, - `${this.state.yMetric.name}: ${formatMeasure(getMeasure(component, this.props.yMetric), - this.state.yMetric.type)}`, - `${sizeMetricsTitle}: ${formatMeasure(this.getSizeMetricsValue(component), sizeMetricsType)}` - ].join('
'); - return `
${inner}
`; - } - - handleBubbleClick (id) { - Workspace.openComponent({ uuid: id }); - } - - renderLoading () { - return
- -
; - } - - renderBubbleChart () { - if (this.state.loading) { - return this.renderLoading(); - } - - let items = this.state.files.map(component => { - return { - x: getMeasure(component, this.props.xMetric), - y: getMeasure(component, this.props.yMetric), - size: this.getSizeMetricsValue(component), - link: component.id, - tooltip: this.getTooltip(component) - }; - }); - let formatXTick = (tick) => formatMeasure(tick, this.state.xMetric.type); - let formatYTick = (tick) => formatMeasure(tick, this.state.yMetric.type); - return ; - } - - render () { - if (this.props.component.qualifier === 'DEV' || this.props.component.qualifier === 'VW') { - return null; - } - - return
-
-

{translate('overview.chart.files')}

-
    -
  • - {translateWithParameters('overview.chart.legend.size_x', this.getSizeMetricsTitle())} -
  • -
-
-
-
- {this.state.yMetric.name} -
- {this.renderBubbleChart()} -
- {this.state.xMetric.name} -
- {this.state.total > BUBBLES_LIMIT && -
{translateWithParameters('overview.chart.files.limit_message', - BUBBLES_LIMIT)}
} -
-
; - } -} - -DomainBubbleChart.propTypes = { - xMetric: React.PropTypes.string.isRequired, - yMetric: React.PropTypes.string.isRequired, - sizeMetrics: React.PropTypes.arrayOf(React.PropTypes.string).isRequired -}; diff --git a/server/sonar-web/src/main/js/apps/overview/components/domain-timeline.js b/server/sonar-web/src/main/js/apps/overview/components/domain-timeline.js deleted file mode 100644 index 8309907aba5..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/components/domain-timeline.js +++ /dev/null @@ -1,258 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import _ from 'underscore'; -import moment from 'moment'; -import React from 'react'; -import Select from 'react-select'; - -import { getTimeMachineData } from '../../../api/time-machine'; -import { getEvents } from '../../../api/events'; -import { formatMeasure, groupByDomain } from '../../../helpers/measures'; -import { getShortType } from '../helpers/metrics'; -import Timeline from './../../../components/charts/Timeline'; -import { translate } from '../../../helpers/l10n'; - - -const HEIGHT = 280; - - -function parseValue (value, type) { - return type === 'RATING' && typeof value === 'string' ? value.charCodeAt(0) - 'A'.charCodeAt(0) + 1 : value; -} - - -export const DomainTimeline = React.createClass({ - propTypes: { - allMetrics: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, - metrics: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, - initialMetric: React.PropTypes.string.isRequired - }, - - getInitialState() { - return { - loading: true, - currentMetric: this.props.initialMetric, - comparisonMetric: '' - }; - }, - - componentDidMount () { - Promise.all([ - this.requestTimeMachineData(this.state.currentMetric, this.state.comparisonMetric), - this.requestEvents() - ]).then(responses => { - this.setState({ - loading: false, - snapshots: responses[0], - events: responses[1] - }); - }); - }, - - requestTimeMachineData (currentMetric, comparisonMetric) { - let metricsToRequest = [currentMetric]; - if (comparisonMetric) { - metricsToRequest.push(comparisonMetric); - } - return getTimeMachineData(this.props.component.key, metricsToRequest.join()).then(r => { - return r[0].cells.map(cell => { - return { date: moment(cell.d).toDate(), values: cell.v }; - }); - }); - }, - - requestEvents () { - return getEvents(this.props.component.key, 'Version').then(r => { - let events = r.map(event => { - return { version: event.n, date: moment(event.dt).toDate() }; - }); - return _.sortBy(events, 'date'); - }); - }, - - handleMetricChange (selected) { - let newMetric = selected.value; - let comparisonMetric = this.state.comparisonMetric; - if (newMetric === comparisonMetric) { - comparisonMetric = ''; - } - this.requestTimeMachineData(newMetric, comparisonMetric).then(snapshots => { - this.setState({ currentMetric: newMetric, comparisonMetric, snapshots }); - }); - }, - - handleComparisonMetricChange (selected) { - let newMetric = selected && selected.value; - this.requestTimeMachineData(this.state.currentMetric, newMetric).then(snapshots => { - this.setState({ comparisonMetric: newMetric, snapshots }); - }); - }, - - groupMetricsByDomain () { - return groupByDomain(this.props.metrics); - }, - - renderLoading () { - return
- -
; - }, - - renderWhenNoHistoricalData () { - return
- There is no historical data. -
; - }, - - renderLineCharts () { - if (this.state.loading) { - return this.renderLoading(); - } - return
- {this.renderLineChart(this.state.snapshots, this.state.currentMetric, 0)} - {this.renderLineChart(this.state.snapshots, this.state.comparisonMetric, 1)} -
; - }, - - renderLineChart (snapshots, metric, index) { - if (!metric) { - return null; - } - - if (snapshots.length < 2) { - return this.renderWhenNoHistoricalData(); - } - - let metricType = _.findWhere(this.props.allMetrics, { key: metric }).type; - let data = snapshots.map(snapshot => { - return { - x: snapshot.date, - y: parseValue(snapshot.values[index], metricType) - }; - }); - - let formatValue = (value) => formatMeasure(value, metricType); - let formatYTick = (tick) => formatMeasure(tick, getShortType(metricType)); - - return
- -
; - }, - - renderTimelineMetricSelect () { - if (this.state.loading) { - return null; - } - - const options = this.props.metrics.map(metric => { - return { - value: metric.key, - label: metric.name, - domain: metric.domain - }; - }); - - // use "disabled" property to emulate optgroups - const optionsWithDomains = []; - options.forEach((option, index, options) => { - const previous = index > 0 ? options[index - 1] : null; - if (!previous || previous.domain !== option.domain) { - optionsWithDomains.push({ - value: option.domain, - label: option.domain, - disabled: true - }); - } - optionsWithDomains.push(option); - }); - - return - - - ; - }, - - render () { - return
-
-
-

{translate('overview.chart.history')}

- {this.renderTimelineMetricSelect()} -
- {this.renderComparisonMetricSelect()} -
-
- {this.renderLineCharts()} -
-
; - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/components/domain-treemap.js b/server/sonar-web/src/main/js/apps/overview/components/domain-treemap.js deleted file mode 100644 index 3addeefc02b..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/components/domain-treemap.js +++ /dev/null @@ -1,172 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import _ from 'underscore'; -import React from 'react'; - -import { Treemap } from '../../../components/charts/treemap'; -import { getChildren } from '../../../api/components'; -import { formatMeasure } from '../../../helpers/measures'; -import { getComponentUrl } from '../../../helpers/urls'; -import { translate, translateWithParameters } from '../../../helpers/l10n'; - - -const HEIGHT = 302; - - -export class DomainTreemap extends React.Component { - constructor (props) { - super(props); - this.state = { - loading: true, - files: [], - sizeMetric: this.getMetricObject(props.metrics, props.sizeMetric), - colorMetric: props.colorMetric ? this.getMetricObject(props.metrics, props.colorMetric) : null, - breadcrumbs: [] - }; - } - - componentDidMount () { - this.requestComponents(this.props.component.key); - } - - requestComponents (componentKey) { - let metrics = [this.props.sizeMetric, this.props.colorMetric]; - return getChildren(componentKey, metrics).then(r => { - let components = r.map(component => { - let measures = {}; - (component.measures || []).forEach(measure => { - measures[measure.metric] = measure.value; - }); - return _.extend(component, { - measures, - key: component.refKey || component.key - }); - }); - this.setState({ loading: false, components }); - }); - } - - getMetricObject (metrics, metricKey) { - return _.findWhere(metrics, { key: metricKey }); - } - - getTooltip (component) { - let inner = [ - component.name, - `${this.state.sizeMetric.name}: - ${formatMeasure(component.measures[this.props.sizeMetric], this.state.sizeMetric.type)}` - ]; - if (this.state.colorMetric) { - let measure = component.measures[this.props.colorMetric]; - let formatted = measure != null ? formatMeasure(measure, this.state.colorMetric.type) : '—'; - inner.push(`${this.state.colorMetric.name}: ${formatted}`); - } - inner = inner.join('
'); - return `
${inner}
`; - } - - handleRectangleClick (node) { - this.requestComponents(node.key).then(() => { - let nextBreadcrumbs = [...this.state.breadcrumbs]; - let index = _.findIndex(this.state.breadcrumbs, b => b.key === node.key); - if (index !== -1) { - nextBreadcrumbs = nextBreadcrumbs.slice(0, index); - } - nextBreadcrumbs = [...nextBreadcrumbs, { - key: node.key, - name: node.name, - qualifier: node.qualifier - }]; - this.setState({ breadcrumbs: nextBreadcrumbs }); - }); - } - - handleReset() { - this.requestComponents(this.props.component.key).then(() => { - this.setState({ breadcrumbs: [] }); - }); - } - - renderLoading () { - return
- -
; - } - - renderTreemap () { - if (this.state.loading) { - return this.renderLoading(); - } - - let items = this.state.components - .filter(component => component.measures[this.props.sizeMetric]) - .map(component => { - let colorMeasure = this.props.colorMetric ? component.measures[this.props.colorMetric] : null; - return { - key: component.key, - name: component.name, - qualifier: component.qualifier, - size: component.measures[this.props.sizeMetric], - color: colorMeasure != null ? this.props.scale(colorMeasure) : '#777', - tooltip: this.getTooltip(component), - label: component.name, - link: getComponentUrl(component.key) - }; - }); - - const canBeClicked = node => node.qualifier !== 'FIL' && node.qualifier !== 'UTS'; - - // FIXME remove this magic number - const height = HEIGHT - 35; - - return ; - } - - render () { - let color = this.props.colorMetric ? -
  • {translateWithParameters('overview.chart.legend.color_x', this.state.colorMetric.name)}
  • : null; - return
    -
    -

    {translate('overview.chart.components')}

    -
      -
    • - {translateWithParameters('overview.chart.legend.size_x', this.state.sizeMetric.name)} -
    • - {color} -
    -
    -
    - {this.renderTreemap()} -
    -
    ; - } -} - -DomainTreemap.propTypes = { - sizeMetric: React.PropTypes.string.isRequired, - colorMetric: React.PropTypes.string, - scale: React.PropTypes.func -}; diff --git a/server/sonar-web/src/main/js/apps/overview/components/issue-measure.js b/server/sonar-web/src/main/js/apps/overview/components/issue-measure.js deleted file mode 100644 index ab06c2c243f..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/components/issue-measure.js +++ /dev/null @@ -1,298 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import moment from 'moment'; -import React from 'react'; - -import { formatMeasure, localizeMetric } from '../../../helpers/measures'; -import { DrilldownLink } from '../../../components/shared/drilldown-link'; -import { IssuesLink } from '../../../components/shared/issues-link'; -import { getShortType } from '../helpers/metrics'; -import SeverityHelper from '../../../components/shared/severity-helper'; -import { translate } from '../../../helpers/l10n'; - - -export const IssueMeasure = React.createClass({ - renderLeak () { - if (!this.props.leakPeriodDate) { - return null; - } - - let leak = this.props.leak[this.props.metric]; - let added = this.props.leak[this.props.leakMetric]; - let removed = added - leak; - - return
    -
      -
    • - - +{formatMeasure(added, getShortType(this.props.type))} - -
    • -
    • - - -{formatMeasure(removed, getShortType(this.props.type))} - -
    • -
    -
    ; - }, - - render () { - let measure = this.props.measures[this.props.metric]; - if (measure == null) { - return null; - } - - return
    -
    - {localizeMetric(this.props.metric)} - - - {formatMeasure(measure, this.props.type)} - - - {this.props.children} -
    - {this.renderLeak()} -
    ; - } -}); - - -export const AddedRemovedMeasure = React.createClass({ - renderLeak () { - if (!this.props.leakPeriodDate) { - return null; - } - - let leak = this.props.leak[this.props.metric]; - let added = this.props.leak[this.props.leakMetric] || 0; - let removed = added - leak; - - let createdAfter = moment(this.props.leakPeriodDate).format('YYYY-MM-DDTHH:mm:ssZZ'); - - return
    -
      -
    • - {translate('overview.added')} - - - {formatMeasure(added, getShortType(this.props.type))} - - -
    • -
    • - {translate('overview.removed')} - - {formatMeasure(removed, getShortType(this.props.type))} - -
    • -
    -
    ; - }, - - render () { - let measure = this.props.measures[this.props.metric]; - if (measure == null) { - return null; - } - - return
    -
    - {localizeMetric(this.props.metric)} - - - {formatMeasure(measure, this.props.type)} - - - {this.props.children} -
    - {this.renderLeak()} -
    ; - } -}); - - -export const AddedRemovedDebt = React.createClass({ - renderLeak () { - if (!this.props.leakPeriodDate) { - return null; - } - - let leak = this.props.leak[this.props.metric]; - let added = this.props.leak[this.props.leakMetric] || 0; - let removed = added - leak; - - return
    -
      -
    • - {translate('overview.added')} - - - {formatMeasure(added, getShortType(this.props.type))} - - -
    • -
    • - {translate('overview.removed')} - - {formatMeasure(removed, getShortType(this.props.type))} - -
    • -
    -
    ; - }, - - render () { - let measure = this.props.measures[this.props.metric]; - if (measure == null) { - return null; - } - - return
    -
    - {localizeMetric(this.props.metric)} - - - {formatMeasure(measure, this.props.type)} - - - {this.props.children} -
    - {this.renderLeak()} -
    ; - } -}); - - -export const OnNewCodeMeasure = React.createClass({ - renderLeak () { - if (!this.props.leakPeriodDate) { - return null; - } - - let onNewCode = this.props.leak[this.props.leakMetric]; - - return
    -
      -
    • - {translate('overview.on_new_code')} - - - {formatMeasure(onNewCode, getShortType(this.props.type))} - - -
    • -
    -
    ; - }, - - render () { - let measure = this.props.measures[this.props.metric]; - if (measure == null) { - return null; - } - - return
    -
    - {localizeMetric(this.props.metric)} - - - {formatMeasure(measure, this.props.type)} - - - {this.props.children} -
    - {this.renderLeak()} -
    ; - } -}); - - -export const SeverityMeasure = React.createClass({ - getMetric () { - return this.props.severity.toLowerCase() + '_violations'; - }, - - getNewMetric () { - return 'new_' + this.props.severity.toLowerCase() + '_violations'; - }, - - - renderLeak () { - if (!this.props.leakPeriodDate) { - return null; - } - - let leak = this.props.leak[this.getMetric()] || 0; - let added = this.props.leak[this.getNewMetric()] || 0; - let removed = added - leak; - - let createdAfter = moment(this.props.leakPeriodDate).format('YYYY-MM-DDTHH:mm:ssZZ'); - - return
    -
      -
    • - {translate('overview.added')} - - - {formatMeasure(added, 'SHORT_INT')} - - -
    • -
    • - {translate('overview.removed')} - - {formatMeasure(removed, 'SHORT_INT')} - -
    • -
    -
    ; - }, - - render () { - let measure = this.props.measures[this.getMetric()]; - if (measure == null) { - return null; - } - - return
    -
    - - - - - - {formatMeasure(measure, 'SHORT_INT')} - - - {this.props.children} -
    - {this.renderLeak()} -
    ; - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/components/issues-assignees.js b/server/sonar-web/src/main/js/apps/overview/components/issues-assignees.js deleted file mode 100644 index 06c0b5713e3..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/components/issues-assignees.js +++ /dev/null @@ -1,50 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import React from 'react'; -import Assignee from '../../../components/shared/assignee-helper'; -import { getComponentIssuesUrl } from '../../../helpers/urls'; -import { formatMeasure } from '../../../helpers/measures'; - - -export default class extends React.Component { - render () { - let rows = this.props.assignees.map(s => { - let params = { statuses: 'OPEN,REOPENED' }; - if (s.val) { - params.assignees = s.val; - } else { - params.assigned = 'false'; - } - let href = getComponentIssuesUrl(this.props.component.key, params); - return - - - - - {formatMeasure(s.count, 'SHORT_INT')} - - ; - }); - - return - {rows} -
    ; - } -} diff --git a/server/sonar-web/src/main/js/apps/overview/components/issues-tags.js b/server/sonar-web/src/main/js/apps/overview/components/issues-tags.js deleted file mode 100644 index a62d65eba49..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/components/issues-tags.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import React from 'react'; - -import { WordCloud } from '../../../components/charts/word-cloud'; -import { getComponentIssuesUrl } from '../../../helpers/urls'; -import { formatMeasure } from '../../../helpers/measures'; - - -export const IssuesTags = React.createClass({ - render () { - let tags = this.props.tags.map(tag => { - let link = getComponentIssuesUrl(this.props.component.key, { resolved: 'false', tags: tag.val }); - let tooltip = `Issues: ${formatMeasure(tag.count, 'SHORT_INT')}`; - return { text: tag.val, size: tag.count, link, tooltip }; - }); - return ; - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/components/ncloc-distribution.js b/server/sonar-web/src/main/js/apps/overview/components/ncloc-distribution.js deleted file mode 100644 index eb1a6f38be2..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/components/ncloc-distribution.js +++ /dev/null @@ -1,122 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import _ from 'underscore'; -import React from 'react'; - -import { Histogram } from '../../../components/charts/histogram'; -import { formatMeasure } from '../../../helpers/measures'; -import { collapsePath } from '../../../helpers/path'; -import { getComponentDrilldownUrl } from '../../../helpers/urls'; -import { getChildren } from '../../../api/components'; -import { translate, translateWithParameters } from '../../../helpers/l10n'; - - -const HEIGHT = 302; -const METRIC = 'ncloc'; - - -export const NclocDistribution = React.createClass({ - propTypes: { - component: React.PropTypes.object.isRequired - }, - - getInitialState() { - return { loading: true, files: [] }; - }, - - componentDidMount () { - this.requestComponents(); - }, - - requestComponents () { - let metrics = [METRIC]; - return getChildren(this.props.component.key, metrics).then(r => { - let components = r.map(component => { - let measures = {}; - (component.measures || []).forEach(measure => { - measures[measure.metric] = measure.value; - }); - return _.extend(component, { measures }); - }); - this.setState({ loading: false, components }); - }); - }, - - handleBarClick(d) { - window.location = getComponentDrilldownUrl(d.component.key, 'ncloc'); - }, - - renderLoading () { - return
    - -
    ; - }, - - renderBarChart () { - if (this.state.loading) { - return this.renderLoading(); - } - - let data = this.state.components.map((component, index) => { - return { - x: component.measures[METRIC] ? parseInt(component.measures[METRIC], 10) : 0, - y: index, - value: component.name, - component - }; - }); - - data = _.sortBy(data, d => -d.x); - - let yTicks = data.map(d => { - return { - label: collapsePath(d.value, 20), - tooltip: d.value - }; - }); - - let yValues = data.map(d => formatMeasure(d.x, 'SHORT_INT')); - - return ; - }, - - render () { - const componentsCount = this.state.components ? this.state.components.length : 1; - const height = componentsCount * 25; - - return
    -
    -

    {translate('overview.chart.components')}

    - - {translateWithParameters('overview.chart.legend.size_x', translate('metric.ncloc.name'))} - -
    -
    - {this.renderBarChart()} -
    -
    ; - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/domains/coverage-domain.js b/server/sonar-web/src/main/js/apps/overview/domains/coverage-domain.js deleted file mode 100644 index d26dc85d1fa..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/domains/coverage-domain.js +++ /dev/null @@ -1,164 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import _ from 'underscore'; -import d3 from 'd3'; -import React from 'react'; - -import { getMeasures } from '../../../api/measures'; -import { DomainTimeline } from '../components/domain-timeline'; -import { DomainTreemap } from '../components/domain-treemap'; -import { DomainBubbleChart } from '../components/domain-bubble-chart'; -import { CoverageSelectionMixin } from '../components/coverage-selection-mixin'; -import { getPeriodLabel, getPeriodDate } from './../helpers/periods'; -import { TooltipsMixin } from '../../../components/mixins/tooltips-mixin'; -import { filterMetrics, filterMetricsForDomains } from '../helpers/metrics'; -import { DomainLeakTitle } from '../main/components'; -import { CHART_REVERSED_COLORS_RANGE_PERCENT } from '../../../helpers/constants'; -import { CoverageMeasuresList } from '../components/coverage-measures-list'; -import { translate } from '../../../helpers/l10n'; - - -const TEST_DOMAINS = ['Tests']; - - -export const CoverageMain = React.createClass({ - mixins: [TooltipsMixin, CoverageSelectionMixin], - - getInitialState() { - return { - ready: false, - leakPeriodLabel: getPeriodLabel(this.props.component.periods, this.props.leakPeriodIndex), - leakPeriodDate: getPeriodDate(this.props.component.periods, this.props.leakPeriodIndex) - }; - }, - - componentDidMount() { - this.requestMeasures().then(r => { - let measures = this.getMeasuresValues(r); - let leak = this.getMeasuresValues(r, Number(this.props.leakPeriodIndex)); - this.setState({ - ready: true, - measures, - leak, - coverageMetricPrefix: this.getCoverageMetricPrefix(measures) - }); - }); - }, - - getMeasuresValues (measures, period) { - let values = {}; - measures.forEach(measure => { - const container = period ? _.findWhere(measure.periods, { index: period }) : measure; - if (container) { - values[measure.metric] = container.value; - } - }); - return values; - }, - - getMetricsForDomain() { - return this.props.metrics - .filter(metric => TEST_DOMAINS.indexOf(metric.domain) !== -1) - .map(metric => metric.key); - }, - - getMetricsForTimeline() { - return filterMetricsForDomains(this.props.metrics, TEST_DOMAINS); - }, - - getAllMetricsForTimeline() { - return filterMetrics(this.props.metrics); - }, - - requestMeasures () { - return getMeasures(this.props.component.key, this.getMetricsForDomain()); - }, - - renderLoading () { - return
    - -
    ; - }, - - renderEmpty() { - return
    -
    -

    {translate('overview.no_coverage')}

    -
    -
    ; - }, - - renderLegend () { - return ; - }, - - render () { - if (!this.state.ready) { - return this.renderLoading(); - } - - let treemapScale = d3.scale.linear() - .domain([0, 25, 50, 75, 100]) - .range(CHART_REVERSED_COLORS_RANGE_PERCENT); - - let coverageMetric = this.state.coverageMetricPrefix + 'coverage'; - let uncoveredLinesMetric = this.state.coverageMetricPrefix + 'uncovered_lines'; - - if (this.state.measures[coverageMetric] == null) { - return this.renderEmpty(); - } - - return
    -
    -
    -
    -
    {translate('overview.domain.coverage')}
    - {this.renderLegend()} -
    - -
    - -
    - -
    -
    - -
    -
    - -
    - -
    - -
    -
    -
    ; - - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/domains/debt-domain.js b/server/sonar-web/src/main/js/apps/overview/domains/debt-domain.js deleted file mode 100644 index 3f998f684a3..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/domains/debt-domain.js +++ /dev/null @@ -1,253 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import _ from 'underscore'; -import d3 from 'd3'; -import React from 'react'; - -import { getMeasures } from '../../../api/measures'; -import { DetailedMeasure } from '../components/detailed-measure'; -import { DomainTimeline } from '../components/domain-timeline'; -import { DomainTreemap } from '../components/domain-treemap'; -import { DomainBubbleChart } from '../components/domain-bubble-chart'; -import { getPeriodLabel, getPeriodDate } from './../helpers/periods'; -import { TooltipsMixin } from '../../../components/mixins/tooltips-mixin'; -import { filterMetrics, filterMetricsForDomains } from '../helpers/metrics'; -import { CHART_COLORS_RANGE_PERCENT } from '../../../helpers/constants'; -import { AddedRemovedMeasure, - AddedRemovedDebt, - OnNewCodeMeasure, - SeverityMeasure } from './../components/issue-measure'; -import { IssuesTags } from './../components/issues-tags'; -import Assignees from './../components/issues-assignees'; -import { getFacet, extractAssignees } from '../../../api/issues'; -import { Rating } from '../../../components/shared/rating'; -import { DrilldownLink } from '../../../components/shared/drilldown-link'; -import { DomainLeakTitle } from '../main/components'; -import { translate } from '../../../helpers/l10n'; - - -const KNOWN_METRICS = ['violations', 'sqale_index', 'sqale_rating', 'sqale_debt_ratio', 'blocker_violations', - 'critical_violations', 'major_violations', 'minor_violations', 'info_violations', 'confirmed_issues']; - - -export const DebtMain = React.createClass({ - mixins: [TooltipsMixin], - - getInitialState() { - return { - ready: false, - leakPeriodLabel: getPeriodLabel(this.props.component.periods, this.props.leakPeriodIndex), - leakPeriodDate: getPeriodDate(this.props.component.periods, this.props.leakPeriodIndex) - }; - }, - - componentDidMount() { - Promise.all([ - this.requestMeasures(), - this.requestIssues(), - this.requestAssignees() - ]).then(responses => { - let measures = this.getMeasuresValues(responses[0]); - let leak = this.getMeasuresValues(responses[0], Number(this.props.leakPeriodIndex)); - let tags = responses[1].facet; - let assignees = extractAssignees(responses[2].facet, responses[2].response); - this.setState({ ready: true, measures, leak, tags, assignees }); - }); - }, - - getMeasuresValues (measures, period) { - let values = {}; - measures.forEach(measure => { - const container = period ? _.findWhere(measure.periods, { index: period }) : measure; - if (container) { - values[measure.metric] = container.value; - } - }); - return values; - }, - - getMetricsForDomain() { - return this.props.metrics - .filter(metric => ['Issues', 'Technical Debt'].indexOf(metric.domain) !== -1) - .map(metric => metric.key); - }, - - getMetricsForTimeline() { - return filterMetricsForDomains(this.props.metrics, ['Issues', 'Technical Debt']); - }, - - getAllMetricsForTimeline() { - return filterMetrics(this.props.metrics); - }, - - requestMeasures () { - return getMeasures(this.props.component.key, this.getMetricsForDomain()); - }, - - getFacet (facets, facetKey) { - return _.findWhere(facets, { property: facetKey }).values; - }, - - requestIssues () { - return getFacet({ - componentUuids: this.props.component.id, - resolved: 'false' - }, 'tags'); - }, - - requestAssignees () { - return getFacet({ - componentUuids: this.props.component.id, - resolved: 'false', - statuses: 'OPEN,REOPENED' - }, 'assignees'); - }, - - renderLoading () { - return
    - -
    ; - }, - - renderLegend () { - return ; - }, - - renderOtherMeasures() { - let metrics = filterMetricsForDomains(this.props.metrics, ['Issues', 'Technical Debt']) - .filter(metric => KNOWN_METRICS.indexOf(metric.key) === -1) - .filter(metric => this.state.measures[metric.key] != null) - .map(metric => { - return ; - }); - if (!metrics.length) { - return null; - } - return
    {metrics}
    ; - }, - - renderRating () { - if (this.state.measures['sqale_rating'] == null) { - return null; - } - return
    -
    - - - - - -
    -
    ; - }, - - renderTags () { - if (!this.state.tags.length) { - return null; - } - return
    -
    - -
    -
    ; - }, - - render () { - if (!this.state.ready) { - return this.renderLoading(); - } - - let treemapScale = d3.scale.ordinal() - .domain([1, 2, 3, 4, 5]) - .range(CHART_COLORS_RANGE_PERCENT); - - return
    -
    -
    -
    -
    {translate('overview.domain.debt')}
    - {this.renderLegend()} -
    - -
    - {this.renderRating()} - - - -
    - -
    - - - - - -
    - -
    - {this.renderTags()} -
    -
    -
    - {translate('overview.unmanaged_issues')} -
    -
    - -
    -
    -
    -
    - - {this.renderOtherMeasures()} -
    - -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    ; - - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/domains/duplications-domain.js b/server/sonar-web/src/main/js/apps/overview/domains/duplications-domain.js deleted file mode 100644 index 6946cbdf962..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/domains/duplications-domain.js +++ /dev/null @@ -1,213 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import _ from 'underscore'; -import d3 from 'd3'; -import React from 'react'; - -import { getMeasures } from '../../../api/measures'; -import { DetailedMeasure } from '../components/detailed-measure'; -import { DomainTimeline } from '../components/domain-timeline'; -import { DomainTreemap } from '../components/domain-treemap'; -import { DomainBubbleChart } from '../components/domain-bubble-chart'; -import { getPeriodLabel, getPeriodDate } from './../helpers/periods'; -import { TooltipsMixin } from '../../../components/mixins/tooltips-mixin'; -import { filterMetrics, filterMetricsForDomains, getMetricName } from '../helpers/metrics'; -import { DomainLeakTitle } from '../main/components'; -import { CHART_COLORS_RANGE_PERCENT } from '../../../helpers/constants'; -import { formatMeasure, formatMeasureVariation } from '../../../helpers/measures'; -import { DonutChart } from '../../../components/charts/donut-chart'; -import { DrilldownLink } from '../../../components/shared/drilldown-link'; -import { translate } from '../../../helpers/l10n'; - - -export const DuplicationsMain = React.createClass({ - mixins: [TooltipsMixin], - - getInitialState() { - return { - ready: false, - leakPeriodLabel: getPeriodLabel(this.props.component.periods, this.props.leakPeriodIndex), - leakPeriodDate: getPeriodDate(this.props.component.periods, this.props.leakPeriodIndex) - }; - }, - - componentDidMount() { - this.requestMeasures().then(r => { - let measures = this.getMeasuresValues(r); - let leak = this.getMeasuresValues(r, Number(this.props.leakPeriodIndex)); - this.setState({ ready: true, measures, leak }); - }); - }, - - getMeasuresValues (measures, period) { - let values = {}; - measures.forEach(measure => { - const container = period ? _.findWhere(measure.periods, { index: period }) : measure; - if (container) { - values[measure.metric] = container.value; - } - }); - return values; - }, - - getMetricsForDomain() { - return this.props.metrics - .filter(metric => ['Duplication'].indexOf(metric.domain) !== -1) - .map(metric => metric.key); - }, - - getMetricsForTimeline() { - return filterMetricsForDomains(this.props.metrics, ['Duplication']); - }, - - getAllMetricsForTimeline() { - return filterMetrics(this.props.metrics); - }, - - requestMeasures () { - return getMeasures(this.props.component.key, this.getMetricsForDomain()); - }, - - renderLoading () { - return
    - -
    ; - }, - - renderEmpty() { - return
    -
    -

    {translate('overview.no_duplications')}

    -
    -
    ; - }, - - renderLegend () { - return ; - }, - - renderMeasures() { - let metrics = filterMetricsForDomains(this.props.metrics, ['Duplication']) - .filter(metric => metric.key !== 'duplicated_lines_density') - .map(metric => { - return ; - }); - return
    {metrics}
    ; - }, - - renderDonut() { - const duplicationsMetric = 'duplicated_lines_density'; - const duplications = this.state.measures[duplicationsMetric]; - const donutData = [ - { value: duplications, fill: '#f3ca8e' }, - { value: Math.max(0, 20 - duplications), fill: '#e6e6e6' } - ]; - return ; - }, - - renderDuplicationsLeak() { - if (!this.state.leakPeriodDate) { - return null; - } - const duplicationsMetric = 'duplicated_lines_density'; - const leak = this.state.leak[duplicationsMetric]; - return
    - - {formatMeasureVariation(leak, 'PERCENT')} - -
    ; - }, - - render () { - if (!this.state.ready) { - return this.renderLoading(); - } - - const duplicationsMetric = 'duplicated_lines_density'; - const duplications = this.state.measures[duplicationsMetric]; - - if (duplications == null) { - return this.renderEmpty(); - } - - let treemapScale = d3.scale.linear() - .domain([0, 25, 50, 75, 100]) - .range(CHART_COLORS_RANGE_PERCENT); - - return
    -
    -
    -
    -
    {translate('overview.domain.duplications')}
    - {this.renderLegend()} -
    -
    -
    -
    - - {getMetricName('duplications')} - - - {this.renderDonut()} - - {formatMeasure(duplications, 'PERCENT')} - - -
    - - {this.renderDuplicationsLeak()} -
    - - {this.renderMeasures()} -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    ; - - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/domains/structure-domain.js b/server/sonar-web/src/main/js/apps/overview/domains/structure-domain.js deleted file mode 100644 index 7caa737642f..00000000000 --- a/server/sonar-web/src/main/js/apps/overview/domains/structure-domain.js +++ /dev/null @@ -1,217 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import _ from 'underscore'; -import React from 'react'; - -import { LanguageDistribution } from './../components/language-distribution'; -import { ComplexityDistribution } from './../components/complexity-distribution'; -import { NclocDistribution } from '../components/ncloc-distribution'; -import { getMeasures } from '../../../api/measures'; -import { DetailedMeasure } from '../components/detailed-measure'; -import { DomainTimeline } from '../components/domain-timeline'; -import { getPeriodLabel, getPeriodDate } from './../helpers/periods'; -import { TooltipsMixin } from '../../../components/mixins/tooltips-mixin'; -import { filterMetrics, filterMetricsForDomains } from '../helpers/metrics'; -import { DomainLeakTitle } from '../main/components'; -import { translate } from '../../../helpers/l10n'; - - -export const StructureMain = React.createClass({ - mixins: [TooltipsMixin], - - getInitialState() { - return { - ready: false, - leakPeriodLabel: getPeriodLabel(this.props.component.periods, this.props.leakPeriodIndex), - leakPeriodDate: getPeriodDate(this.props.component.periods, this.props.leakPeriodIndex) - }; - }, - - componentDidMount() { - this.requestMeasures().then(r => { - let measures = this.getMeasuresValues(r); - let leak = this.getMeasuresValues(r, Number(this.props.leakPeriodIndex)); - this.setState({ ready: true, measures, leak }); - }); - }, - - getMeasuresValues (measures, period) { - let values = {}; - measures.forEach(measure => { - const container = period ? _.findWhere(measure.periods, { index: period }) : measure; - if (container) { - values[measure.metric] = container.value; - } - }); - return values; - }, - - getMetricsForDomain() { - return this.props.metrics - .filter(metric => ['Size', 'Complexity', 'Documentation'].indexOf(metric.domain) !== -1) - .map(metric => metric.key); - }, - - getMetricsForTimeline() { - return filterMetricsForDomains(this.props.metrics, ['Size', 'Complexity', 'Documentation']); - }, - - getAllMetricsForTimeline() { - return filterMetrics(this.props.metrics); - }, - - requestMeasures () { - return getMeasures(this.props.component.key, this.getMetricsForDomain()); - }, - - renderLoading () { - return
    - -
    ; - }, - - renderLegend () { - return ; - }, - - renderOtherMeasures(domain, hiddenMetrics) { - let metrics = filterMetricsForDomains(this.props.metrics, [domain]) - .filter(metric => hiddenMetrics.indexOf(metric.key) === -1) - .map(metric => { - return ; - }); - return
    {metrics}
    ; - }, - - renderOtherSizeMeasures() { - return this.renderOtherMeasures('Size', ['ncloc']); - }, - - renderOtherComplexityMeasures() { - return this.renderOtherMeasures('Complexity', - ['complexity', 'function_complexity', 'file_complexity', 'class_complexity']); - }, - - renderOtherDocumentationMeasures() { - return this.renderOtherMeasures('Documentation', []); - }, - - renderLanguageDistribution() { - let distribution = this.state.measures['ncloc_language_distribution']; - if (distribution == null) { - return null; - } - return ; - }, - - renderComplexityDistribution(distribution, props) { - if (distribution == null) { - return null; - } - return ; - }, - - renderComplexityCard() { - if (this.state.measures['complexity'] == null) { - return null; - } - - return
    -
    - - - {this.renderComplexityDistribution(this.state.measures['function_complexity_distribution'], - { of: 'function' })} - - - {this.renderComplexityDistribution(this.state.measures['file_complexity_distribution'], - { of: 'file' })} - - - {this.renderOtherComplexityMeasures()} -
    -
    ; - }, - - render () { - if (!this.state.ready) { - return this.renderLoading(); - } - return
    -
    -
    -
    {translate('overview.domain.structure')}
    - {this.renderLegend()} -
    - -
    -
    -
    - - {this.renderLanguageDistribution()} - - {this.renderOtherSizeMeasures()} -
    -
    - - {this.renderComplexityCard()} - -
    -
    - {this.renderOtherDocumentationMeasures()} -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    ; - - } -}); diff --git a/server/sonar-web/src/main/js/apps/overview/gate/gate-condition.js b/server/sonar-web/src/main/js/apps/overview/gate/gate-condition.js index 4b13f065170..5279ab40176 100644 --- a/server/sonar-web/src/main/js/apps/overview/gate/gate-condition.js +++ b/server/sonar-web/src/main/js/apps/overview/gate/gate-condition.js @@ -30,7 +30,7 @@ const Measure = React.createClass({ if (this.props.value == null || isNaN(this.props.value)) { return null; } - let formatted = formatMeasure(this.props.value, this.props.type); + const formatted = formatMeasure(this.props.value, this.props.type); return {formatted}; } }); @@ -38,14 +38,14 @@ const Measure = React.createClass({ export default React.createClass({ render() { - let metricName = translate('metric', this.props.condition.metric.name, 'name'); - let threshold = this.props.condition.level === 'ERROR' ? - this.props.condition.error : this.props.condition.warning; - let period = this.props.condition.period ? - getPeriodLabel(this.props.component.periods, this.props.condition.period) : null; - let periodDate = getPeriodDate(this.props.component.periods, this.props.condition.period); + const metricName = translate('metric', this.props.condition.metric.name, 'name'); + const threshold = this.props.condition.level === 'ERROR' ? + this.props.condition.error : this.props.condition.warning; + const period = this.props.condition.period ? + getPeriodLabel(this.props.component.periods, this.props.condition.period) : null; + const periodDate = getPeriodDate(this.props.component.periods, this.props.condition.period); - let classes = 'alert_' + this.props.condition.level.toUpperCase(); + const classes = 'alert_' + this.props.condition.level.toUpperCase(); return (
  • diff --git a/server/sonar-web/src/main/js/apps/overview/gate/gate-conditions.js b/server/sonar-web/src/main/js/apps/overview/gate/gate-conditions.js index 9943c6fab72..99dd41b43f6 100644 --- a/server/sonar-web/src/main/js/apps/overview/gate/gate-conditions.js +++ b/server/sonar-web/src/main/js/apps/overview/gate/gate-conditions.js @@ -27,7 +27,7 @@ export default React.createClass({ }, render() { - let conditions = this.props.gate.conditions + const conditions = this.props.gate.conditions .filter(c => c.level !== 'OK') .map(c => ); return
      {conditions}
    ; diff --git a/server/sonar-web/src/main/js/apps/overview/gate/gate-empty.js b/server/sonar-web/src/main/js/apps/overview/gate/gate-empty.js index 4ad5565b59b..fa339aca23c 100644 --- a/server/sonar-web/src/main/js/apps/overview/gate/gate-empty.js +++ b/server/sonar-web/src/main/js/apps/overview/gate/gate-empty.js @@ -22,7 +22,7 @@ import { translate } from '../../../helpers/l10n'; export default React.createClass({ render() { - let qualityGatesUrl = '/quality_gates'; + const qualityGatesUrl = '/quality_gates'; return (
    diff --git a/server/sonar-web/src/main/js/apps/overview/gate/gate.js b/server/sonar-web/src/main/js/apps/overview/gate/gate.js index 4705e8f7af6..934e117f286 100644 --- a/server/sonar-web/src/main/js/apps/overview/gate/gate.js +++ b/server/sonar-web/src/main/js/apps/overview/gate/gate.js @@ -46,9 +46,9 @@ export default React.createClass({ return this.props.component.qualifier === 'TRK' ? : null; } - let level = this.props.gate.level.toLowerCase(); - let badgeClassName = 'badge badge-' + level; - let badgeText = translate('overview.gate', this.props.gate.level); + const level = this.props.gate.level.toLowerCase(); + const badgeClassName = 'badge badge-' + level; + const badgeText = translate('overview.gate', this.props.gate.level); return (
    diff --git a/server/sonar-web/src/main/js/apps/overview/helpers/metrics.js b/server/sonar-web/src/main/js/apps/overview/helpers/metrics.js index ce3cd1d6b60..1a37e037c2a 100644 --- a/server/sonar-web/src/main/js/apps/overview/helpers/metrics.js +++ b/server/sonar-web/src/main/js/apps/overview/helpers/metrics.js @@ -19,43 +19,6 @@ */ import { translate } from '../../../helpers/l10n'; -function hasRightDomain (metric, domains) { - return domains.indexOf(metric.domain) !== -1; -} - -function isNotHidden (metric) { - return !metric.hidden; -} - -function hasSimpleType (metric) { - return metric.type !== 'DATA' && metric.type !== 'DISTRIB'; -} - -function isNotDifferential (metric) { - return metric.key.indexOf('new_') !== 0; -} - -export function filterMetrics (metrics) { - return metrics.filter(metric => { - return isNotHidden(metric) && hasSimpleType(metric) && isNotDifferential(metric); - }); -} - -export function filterMetricsForDomains (metrics, domains) { - return filterMetrics(metrics).filter(metric => hasRightDomain(metric, domains)); -} - - -export function getShortType (type) { - if (type === 'INT') { - return 'SHORT_INT'; - } else if (type === 'WORK_DUR') { - return 'SHORT_WORK_DUR'; - } - return type; -} - - export function getMetricName (metricKey) { return translate('overview.metric', metricKey); } diff --git a/server/sonar-web/src/main/js/apps/overview/main/components.js b/server/sonar-web/src/main/js/apps/overview/main/components.js index 80ab66122d7..7113db33759 100644 --- a/server/sonar-web/src/main/js/apps/overview/main/components.js +++ b/server/sonar-web/src/main/js/apps/overview/main/components.js @@ -21,7 +21,7 @@ import moment from 'moment'; import React from 'react'; import { Timeline } from './timeline'; -import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { translateWithParameters } from '../../../helpers/l10n'; export const Domain = React.createClass({ @@ -33,20 +33,7 @@ export const Domain = React.createClass({ export const DomainTitle = React.createClass({ render () { - if (this.props.linkTo) { - let url = '/overview' + this.props.linkTo + '?id=' + encodeURIComponent(this.props.component.key); - return
    -
    - {this.props.children} - - {translate('more')}  - - -
    -
    ; - } else { - return
    {this.props.children}
    ; - } + return
    {this.props.children}
    ; } }); @@ -63,9 +50,9 @@ export const DomainLeakTitle = React.createClass({ if (!this.props.label || !this.props.date) { return null; } - let momentDate = moment(this.props.date); - let fromNow = momentDate.fromNow(); - let tooltip = 'Started on ' + momentDate.format('LL'); + const momentDate = moment(this.props.date); + const fromNow = momentDate.fromNow(); + const tooltip = 'Started on ' + momentDate.format('LL'); if (this.props.inline) { return this.renderInline(tooltip, fromNow); } @@ -156,10 +143,10 @@ export const Measure = React.createClass({ export const DomainMixin = { renderTimelineStartDate() { - let momentDate = moment(this.props.historyStartDate); - let fromNow = momentDate.fromNow(); + const momentDate = moment(this.props.historyStartDate); + const fromNow = momentDate.fromNow(); return ( - + {translateWithParameters('overview.started_x', fromNow)} ); @@ -169,7 +156,7 @@ export const DomainMixin = { if (!this.props.history) { return null; } - let props = { history: this.props.history }; + const props = { history: this.props.history }; props[range] = this.props.leakPeriodDate; return
    diff --git a/server/sonar-web/src/main/js/apps/overview/main/coverage.js b/server/sonar-web/src/main/js/apps/overview/main/coverage.js index 84637a24738..dcab23f842b 100644 --- a/server/sonar-web/src/main/js/apps/overview/main/coverage.js +++ b/server/sonar-web/src/main/js/apps/overview/main/coverage.js @@ -54,7 +54,7 @@ export const GeneralCoverage = React.createClass({ }, renderNewCoverage () { - let newCoverageMetric = this.getNewCoverageMetric(); + const newCoverageMetric = this.getNewCoverageMetric(); if (this.props.leak[newCoverageMetric] != null) { return + title={translate('overview.domain.coverage')}/> diff --git a/server/sonar-web/src/main/js/apps/overview/main/debt.js b/server/sonar-web/src/main/js/apps/overview/main/debt.js index 51f4c810bd1..a8056ca254c 100644 --- a/server/sonar-web/src/main/js/apps/overview/main/debt.js +++ b/server/sonar-web/src/main/js/apps/overview/main/debt.js @@ -51,7 +51,7 @@ export const GeneralDebt = React.createClass({ return null; } - let createdAfter = moment(this.props.leakPeriodDate).format('YYYY-MM-DDTHH:mm:ssZZ'); + const createdAfter = moment(this.props.leakPeriodDate).format('YYYY-MM-DDTHH:mm:ssZZ'); return @@ -77,8 +77,7 @@ export const GeneralDebt = React.createClass({ render () { return + title={translate('overview.domain.debt')}/> diff --git a/server/sonar-web/src/main/js/apps/overview/main/duplications.js b/server/sonar-web/src/main/js/apps/overview/main/duplications.js index 181fc4c3e3f..066a4808eee 100644 --- a/server/sonar-web/src/main/js/apps/overview/main/duplications.js +++ b/server/sonar-web/src/main/js/apps/overview/main/duplications.js @@ -47,8 +47,8 @@ export const GeneralDuplications = React.createClass({ if (!this.hasLeakPeriod()) { return null; } - let measure = this.props.leak['duplicated_lines_density']; - let formatted = measure != null ? formatMeasureVariation(measure, 'PERCENT') : '—'; + const measure = this.props.leak['duplicated_lines_density']; + const formatted = measure != null ? formatMeasureVariation(measure, 'PERCENT') : '—'; return @@ -71,15 +71,14 @@ export const GeneralDuplications = React.createClass({ }, render () { - let donutData = [ + const donutData = [ { value: this.props.measures['duplicated_lines_density'], fill: '#f3ca8e' }, { value: Math.max(0, 20 - this.props.measures['duplicated_lines_density']), fill: '#e6e6e6' } ]; return + title={translate('overview.domain.duplications')}/> diff --git a/server/sonar-web/src/main/js/apps/overview/main/main.js b/server/sonar-web/src/main/js/apps/overview/main/main.js index c9d01b4b87c..12332ddd36b 100644 --- a/server/sonar-web/src/main/js/apps/overview/main/main.js +++ b/server/sonar-web/src/main/js/apps/overview/main/main.js @@ -76,7 +76,7 @@ export default React.createClass({ this.requestIssuesAndDebt(), this.requestLeakIssuesAndDebt() ]).then(responses => { - let measures = this.getMeasuresValues(responses[0]); + const measures = this.getMeasuresValues(responses[0]); measures.issues = responses[1].issues; measures.debt = responses[1].debt; @@ -101,7 +101,7 @@ export default React.createClass({ }, getMeasuresValues (measures, period) { - let values = {}; + const values = {}; measures.forEach(measure => { const container = period ? _.findWhere(measure.periods, { index: period }) : measure; if (container) { @@ -125,7 +125,7 @@ export default React.createClass({ return Promise.resolve(); } - let createdAfter = moment(this.state.leakPeriodDate).format('YYYY-MM-DDTHH:mm:ssZZ'); + const createdAfter = moment(this.state.leakPeriodDate).format('YYYY-MM-DDTHH:mm:ssZZ'); // FIXME requesting severities facet only to get debtTotal return getIssuesCount({ @@ -137,18 +137,18 @@ export default React.createClass({ }, requestHistory () { - let coverageMetric = this.state.coverageMetricPrefix + 'coverage'; - let metrics = [].concat(HISTORY_METRICS_LIST, coverageMetric).join(','); + const coverageMetric = this.state.coverageMetricPrefix + 'coverage'; + const metrics = [].concat(HISTORY_METRICS_LIST, coverageMetric).join(','); return getTimeMachineData(this.props.component.key, metrics).then(r => { - let history = {}; + const history = {}; r[0].cols.forEach((col, index) => { history[col.metric] = r[0].cells.map(cell => { - let date = moment(cell.d).toDate(); - let value = cell.v[index] || 0; + const date = moment(cell.d).toDate(); + const value = cell.v[index] || 0; return { date, value }; }); }); - let historyStartDate = history[HISTORY_METRICS_LIST[0]][0].date; + const historyStartDate = history[HISTORY_METRICS_LIST[0]][0].date; this.setState({ history, historyStartDate }); }); }, @@ -164,8 +164,8 @@ export default React.createClass({ return this.renderLoading(); } - let coverageMetric = this.state.coverageMetricPrefix + 'coverage'; - let props = _.extend({}, this.props, this.state); + const coverageMetric = this.state.coverageMetricPrefix + 'coverage'; + const props = _.extend({}, this.props, this.state); return
    diff --git a/server/sonar-web/src/main/js/apps/overview/main/structure.js b/server/sonar-web/src/main/js/apps/overview/main/structure.js index 0e794d06126..eb3c156293c 100644 --- a/server/sonar-web/src/main/js/apps/overview/main/structure.js +++ b/server/sonar-web/src/main/js/apps/overview/main/structure.js @@ -47,8 +47,8 @@ export const GeneralStructure = React.createClass({ if (!this.hasLeakPeriod()) { return null; } - let measure = this.props.leak['ncloc']; - let formatted = measure != null ? formatMeasureVariation(measure, 'SHORT_INT') : '—'; + const measure = this.props.leak['ncloc']; + const formatted = measure != null ? formatMeasureVariation(measure, 'SHORT_INT') : '—'; return {formatted} @@ -72,8 +72,7 @@ export const GeneralStructure = React.createClass({ render () { return + title={translate('overview.domain.structure')}/> diff --git a/server/sonar-web/src/main/js/apps/overview/main/timeline.js b/server/sonar-web/src/main/js/apps/overview/main/timeline.js index 2be75a74bfc..89a36ac30d9 100644 --- a/server/sonar-web/src/main/js/apps/overview/main/timeline.js +++ b/server/sonar-web/src/main/js/apps/overview/main/timeline.js @@ -29,24 +29,24 @@ const HEIGHT = 80; export class Timeline extends React.Component { filterSnapshots () { return this.props.history.filter(s => { - let matchBefore = !this.props.before || s.date <= this.props.before; - let matchAfter = !this.props.after || s.date >= this.props.after; + const matchBefore = !this.props.before || s.date <= this.props.before; + const matchAfter = !this.props.after || s.date >= this.props.after; return matchBefore && matchAfter; }); } render () { - let snapshots = this.filterSnapshots(); + const snapshots = this.filterSnapshots(); if (snapshots.length < 2) { return null; } - let data = snapshots.map((snapshot, index) => { + const data = snapshots.map((snapshot, index) => { return { x: index, y: snapshot.value }; }); - let domain = [0, d3.max(this.props.history, d => d.value)]; + const domain = [0, d3.max(this.props.history, d => d.value)]; return { + const profiles = (this.props.component.profiles || []).map(profile => { return (
  • ({profile.language}) @@ -73,8 +73,8 @@ export default React.createClass({
  • ); }); - let links = (this.props.component.links || []).map(link => { - let iconClassName = `spacer-right icon-color-link icon-${link.type}`; + const links = (this.props.component.links || []).map(link => { + const iconClassName = `spacer-right icon-color-link icon-${link.type}`; return (
  • @@ -83,19 +83,19 @@ export default React.createClass({ ); }); - let descriptionCard = this.props.component.description ? ( + const descriptionCard = this.props.component.description ? (
    {this.props.component.description}
    ) : null; - let linksCard = _.size(this.props.component.links) > 0 ? ( + const linksCard = _.size(this.props.component.links) > 0 ? (
      {links}
    ) : null; - let keyCard = ( + const keyCard = (

    {translate('key')}

    ); - let profilesCard = !this.isView() && !this.isDeveloper() && _.size(this.props.component.profiles) > 0 ? ( + const profilesCard = !this.isView() && !this.isDeveloper() && _.size(this.props.component.profiles) > 0 ? (

    {translate('overview.quality_profiles')}

      {profiles}
    ) : null; - let gateCard = !this.isView() && !this.isDeveloper() && this.props.component.gate ? ( + const gateCard = !this.isView() && !this.isDeveloper() && this.props.component.gate ? (

    {translate('overview.quality_gate')}

      diff --git a/server/sonar-web/src/main/js/apps/overview/overview.js b/server/sonar-web/src/main/js/apps/overview/overview.js index ad358b4ed11..00f592bdae3 100644 --- a/server/sonar-web/src/main/js/apps/overview/overview.js +++ b/server/sonar-web/src/main/js/apps/overview/overview.js @@ -22,10 +22,6 @@ import React from 'react'; import Gate from './gate/gate'; import GeneralMain from './main/main'; import Meta from './meta'; -import { StructureMain } from './domains/structure-domain'; -import { DuplicationsMain } from './domains/duplications-domain'; -import { CoverageMain } from './domains/coverage-domain'; -import { DebtMain } from './domains/debt-domain'; import { getMetrics } from '../../api/metrics'; import { RouterMixin } from '../../components/router/router'; @@ -63,48 +59,12 @@ export const Overview = React.createClass({
    ; }, - renderSize () { - return
    - -
    ; - }, - - renderDuplications () { - return
    - -
    ; - }, - - renderTests () { - return
    - -
    ; - }, - - renderIssues () { - return
    - -
    ; - }, - render () { if (!this.state.ready) { return this.renderLoading(); } - switch (this.state.route) { - case '': - return this.renderMain(); - case '/structure': - return this.renderSize(); - case '/duplications': - return this.renderDuplications(); - case '/coverage': - return this.renderTests(); - case '/debt': - return this.renderIssues(); - default: - throw new Error('Unknown route: ' + this.state.route); - } + + return this.renderMain(); } }); diff --git a/server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js b/server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js index 84c4f277689..eb7223ab3f3 100644 --- a/server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js +++ b/server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js @@ -30,15 +30,6 @@ import { getComponentDashboardManagementUrl } from '../../../helpers/urls'; - -const FIXED_DASHBOARDS = [ - { link: '', name: 'overview.page' }, - { link: '/debt', name: 'overview.domain.debt' }, - { link: '/coverage', name: 'overview.domain.coverage' }, - { link: '/duplications', name: 'overview.domain.duplications' }, - { link: '/structure', name: 'overview.domain.structure' } -]; - const SETTINGS_URLS = [ '/project/settings', '/project/profile', @@ -68,69 +59,67 @@ export default React.createClass({ }, periodParameter() { - let params = qs.parse(window.location.search.substr(1)); + const params = qs.parse(window.location.search.substr(1)); return params.period ? `&period=${params.period}` : ''; }, getPeriod() { - let params = qs.parse(window.location.search.substr(1)); + const params = qs.parse(window.location.search.substr(1)); return params.period; }, - isFixedDashboardActive(fixedDashboard) { - let path = window.location.pathname; - return path === `/overview${fixedDashboard.link}`; + isFixedDashboardActive() { + const path = window.location.pathname; + return path.indexOf('/overview') === 0; }, isCustomDashboardActive(customDashboard) { - let path = window.location.pathname; - let params = qs.parse(window.location.search.substr(1)); + const path = window.location.pathname; + const params = qs.parse(window.location.search.substr(1)); return path.indexOf('/dashboard') === 0 && params['did'] === `${customDashboard.key}`; }, isCustomDashboardsActive () { - let dashboards = this.props.component.dashboards; + const dashboards = this.props.component.dashboards; return _.any(dashboards, this.isCustomDashboardActive) || this.isDashboardManagementActive() || this.isDefaultDeveloperDashboardActive(); }, isDefaultDeveloperDashboardActive() { - let path = window.location.pathname; + const path = window.location.pathname; return this.isDeveloper() && path.indexOf('/dashboard') === 0; }, isDashboardManagementActive () { - let path = window.location.pathname; + const path = window.location.pathname; return path.indexOf('/dashboards') === 0; }, - renderFixedDashboards() { - return FIXED_DASHBOARDS.map(fixedDashboard => { - let key = 'fixed-dashboard-' + fixedDashboard.link.substr(1); - let url = getComponentFixedDashboardUrl(this.props.component.key, fixedDashboard.link); - let name = fixedDashboard.link !== '' ? - translate(fixedDashboard.name) : ; - let className = classNames({ active: this.isFixedDashboardActive(fixedDashboard) }); - return
  • - {name} -
  • ; - }); + renderOverviewLink() { + const url = getComponentFixedDashboardUrl(this.props.component.key, ''); + const name = ; + const className = classNames({ active: this.isFixedDashboardActive() }); + return ( +
  • + {name} +
  • + ); }, renderCustomDashboard(customDashboard) { - let key = 'custom-dashboard-' + customDashboard.key; - let url = getComponentDashboardUrl(this.props.component.key, customDashboard.key, this.getPeriod()); - let name = getLocalizedDashboardName(customDashboard.name); - let className = classNames({ active: this.isCustomDashboardActive(customDashboard) }); + const key = 'custom-dashboard-' + customDashboard.key; + const url = getComponentDashboardUrl(this.props.component.key, customDashboard.key, this.getPeriod()); + const name = getLocalizedDashboardName(customDashboard.name); + const className = classNames({ active: this.isCustomDashboardActive(customDashboard) }); return
  • {name}
  • ; }, renderCustomDashboards() { - let dashboards = this.props.component.dashboards.map(this.renderCustomDashboard); - let className = classNames('dropdown', { active: this.isCustomDashboardsActive() }); + const dashboards = this.props.component.dashboards.map(this.renderCustomDashboard); + const className = classNames('dropdown', { active: this.isCustomDashboardsActive() }); const managementLink = this.renderDashboardsManagementLink(); return
  • @@ -149,10 +138,10 @@ export default React.createClass({ if (!window.SS.user) { return null; } - let key = 'dashboard-management'; - let url = getComponentDashboardManagementUrl(this.props.component.key); - let name = translate('dashboard.manage_dashboards'); - let className = classNames('pill-right', { active: this.isDashboardManagementActive() }); + const key = 'dashboard-management'; + const url = getComponentDashboardManagementUrl(this.props.component.key); + const name = translate('dashboard.manage_dashboards'); + const className = classNames('pill-right', { active: this.isDashboardManagementActive() }); return
  • {name}
  • ; @@ -187,7 +176,7 @@ export default React.createClass({ }, renderAdministration() { - let shouldShowAdministration = + const shouldShowAdministration = this.props.conf.showActionPlans || this.props.conf.showBackgroundTasks || this.props.conf.showDeletion || @@ -202,10 +191,10 @@ export default React.createClass({ if (!shouldShowAdministration) { return null; } - let isSettingsActive = SETTINGS_URLS.some(url => { + const isSettingsActive = SETTINGS_URLS.some(url => { return window.location.href.indexOf(url) !== -1; }); - let className = 'dropdown' + (isSettingsActive ? ' active' : ''); + const className = 'dropdown' + (isSettingsActive ? ' active' : ''); return (
  • @@ -319,18 +308,18 @@ export default React.createClass({ }, renderExtensions() { - let extensions = this.props.conf.extensions || []; + const extensions = this.props.conf.extensions || []; return extensions.map(e => { return this.renderLink(e.url, e.name, e.url); }); }, renderTools() { - let component = this.props.component; + const component = this.props.component; if (!component.isComparable && !_.size(component.extensions)) { return null; } - let tools = []; + const tools = []; (component.extensions || []).forEach(e => { tools.push(this.renderLink(e.url, e.name)); }); @@ -338,17 +327,31 @@ export default React.createClass({ }, render() { - return ( -
      - {!this.isDeveloper() && this.renderFixedDashboards()} - {this.renderCustomDashboards()} - {this.renderCodeLink()} - {this.renderProjectsLink()} - {this.renderComponentIssuesLink()} - {this.renderComponentMeasuresLink()} - {this.renderTools()} - {this.renderAdministration()} -
    - ); + if (this.isDeveloper()) { + return ( +
      + {this.renderCustomDashboards()} + {this.renderComponentIssuesLink()} + {this.renderComponentMeasuresLink()} + {this.renderCodeLink()} + {this.renderProjectsLink()} + {this.renderTools()} + {this.renderAdministration()} +
    + ); + } else { + return ( +
      + {this.renderOverviewLink()} + {this.renderComponentIssuesLink()} + {this.renderComponentMeasuresLink()} + {this.renderCodeLink()} + {this.renderProjectsLink()} + {this.renderCustomDashboards()} + {this.renderTools()} + {this.renderAdministration()} +
    + ); + } } }); diff --git a/server/sonar-web/tests/apps/overview/components/issues-tags-test.js b/server/sonar-web/tests/apps/overview/components/issues-tags-test.js deleted file mode 100644 index 67d90c7c11f..00000000000 --- a/server/sonar-web/tests/apps/overview/components/issues-tags-test.js +++ /dev/null @@ -1,45 +0,0 @@ -import { expect } from 'chai'; -import React from 'react'; -import TestUtils from 'react-addons-test-utils'; - -import { IssuesTags } from '../../../../src/main/js/apps/overview/components/issues-tags'; -import { WordCloud } from '../../../../src/main/js/components/charts/word-cloud'; - - -const COMPONENT = { key: 'component-key' }; - -const TAGS = [ - { val: 'first', count: 3 }, - { val: 'second', count: 7000 }, - { val: 'third', count: 2 } -]; - - -describe('IssuesTags', function () { - it('should pass right data', function () { - let renderer = TestUtils.createRenderer(); - renderer.render(); - let output = renderer.getRenderOutput(); - expect(output.type).to.equal(WordCloud); - expect(output.props.items).to.deep.equal([ - { - "link": '/component_issues?id=component-key#resolved=false|tags=first', - "size": 3, - "text": 'first', - "tooltip": 'Issues: 3' - }, - { - "link": '/component_issues?id=component-key#resolved=false|tags=second', - "size": 7000, - "text": 'second', - "tooltip": 'Issues: 7k' - }, - { - "link": '/component_issues?id=component-key#resolved=false|tags=third', - "size": 2, - "text": 'third', - "tooltip": 'Issues: 2' - } - ]); - }); -}); diff --git a/server/sonar-web/tests/apps/overview/helpers/metrics-test.js b/server/sonar-web/tests/apps/overview/helpers/metrics-test.js deleted file mode 100644 index e090ea54ed3..00000000000 --- a/server/sonar-web/tests/apps/overview/helpers/metrics-test.js +++ /dev/null @@ -1,110 +0,0 @@ -import { expect } from 'chai'; - -import { filterMetrics, filterMetricsForDomains, getShortType, getMetricName } from - '../../../../src/main/js/apps/overview/helpers/metrics'; - - -const METRICS = [ - { key: 'normal_metric', type: 'INT', hidden: false }, - { key: 'hidden_metric', type: 'INT', hidden: true }, - { key: 'DATA_metric', type: 'DATA', hidden: false }, - { key: 'DISTRIB_metric', type: 'DISTRIB', hidden: false }, - { key: 'new_metric', type: 'FLOAT', hidden: false } -]; - - -describe('Overview Helpers', function () { - describe('Metrics', function () { - - describe('#filterMetrics', function () { - it('should filter out hidden metrics', function () { - let metrics = [ - { key: 'normal_metric', type: 'INT', hidden: false }, - { key: 'hidden_metric', type: 'INT', hidden: true } - ]; - expect(filterMetrics(metrics)).to.have.length(1); - }); - - it('should filter out DATA and DISTRIB metrics', function () { - let metrics = [ - { key: 'normal_metric', type: 'INT', hidden: false }, - { key: 'DATA_metric', type: 'DATA', hidden: false }, - { key: 'DISTRIB_metric', type: 'DISTRIB', hidden: false } - ]; - expect(filterMetrics(metrics)).to.have.length(1); - }); - - it('should filter out differential metrics', function () { - let metrics = [ - { key: 'normal_metric', type: 'INT', hidden: false }, - { key: 'new_metric', type: 'FLOAT', hidden: false } - ]; - expect(filterMetrics(metrics)).to.have.length(1); - }); - }); - - describe('#filterMetricsForDomains', function () { - it('should filter out hidden metrics', function () { - let metrics = [ - { key: 'normal_metric', type: 'INT', hidden: false, domain: 'first' }, - { key: 'hidden_metric', type: 'INT', hidden: true, domain: 'first' } - ]; - expect(filterMetricsForDomains(metrics, ['first'])).to.have.length(1); - }); - - it('should filter out DATA and DISTRIB metrics', function () { - let metrics = [ - { key: 'normal_metric', type: 'INT', hidden: false, domain: 'first' }, - { key: 'DATA_metric', type: 'DATA', hidden: false, domain: 'first' }, - { key: 'DISTRIB_metric', type: 'DISTRIB', hidden: false, domain: 'first' } - ]; - expect(filterMetricsForDomains(metrics, ['first'])).to.have.length(1); - }); - - it('should filter out differential metrics', function () { - let metrics = [ - { key: 'normal_metric', type: 'INT', hidden: false, domain: 'first' }, - { key: 'new_metric', type: 'FLOAT', hidden: false, domain: 'first' } - ]; - expect(filterMetricsForDomains(metrics, ['first'])).to.have.length(1); - }); - - it('should filter metrics by domains', function () { - let metrics = [ - { key: 'normal_metric', type: 'INT', hidden: false, domain: 'first' }, - { key: 'normal_metric1', type: 'INT', hidden: false, domain: 'second' }, - { key: 'normal_metric2', type: 'INT', hidden: false, domain: 'third' }, - { key: 'normal_metric3', type: 'INT', hidden: false, domain: 'second' } - ]; - expect(filterMetricsForDomains(metrics, ['first', 'second'])).to.have.length(3); - }); - }); - - - describe('#getShortType', function () { - it('should shorten INT', function () { - expect(getShortType('INT')).to.equal('SHORT_INT'); - }); - - it('should shorten WORK_DUR', function () { - expect(getShortType('WORK_DUR')).to.equal('SHORT_WORK_DUR'); - }); - - it('should not shorten FLOAT', function () { - expect(getShortType('FLOAT')).to.equal('FLOAT'); - }); - - it('should not shorten PERCENT', function () { - expect(getShortType('PERCENT')).to.equal('PERCENT'); - }); - }); - - - describe('#getMetricName', function () { - it('should return metric name', function () { - expect(getMetricName('metric_name')).to.equal('overview.metric.metric_name'); - }); - }); - - }); -}); diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index dcab3bf5134..2465c6726a9 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -3163,11 +3163,7 @@ overview.quality_gate=Quality Gate overview.quality_profiles=Quality Profiles overview.leak_period_x=Leak Period: {0} overview.started_x=started {0} -overview.project_in_a_nutshell=Project In a Nutshell -overview.unmanaged_issues=Unmanaged Issues overview.on_new_code=On New Code -overview.added=Added -overview.removed=Removed overview.metric.issues=Issues overview.metric.debt=Debt @@ -3203,19 +3199,9 @@ overview.domain.coverage=Coverage overview.domain.duplications=Duplications overview.domain.structure=Structure -overview.chart.files=Files -overview.chart.files.limit_message=Only {0} files are displayed. -overview.chart.components=Components -overview.chart.history=History -overview.chart.legend.size_x=Size: {0} -overview.chart.legend.color_x=Color: {0} - overview.complexity_tooltip.function={0} functions have complexity around {1} overview.complexity_tooltip.file={0} files have complexity around {1} -overview.no_coverage=This component does not have coverage details. -overview.no_duplications=This component does not have details details. - #------------------------------------------------------------------------------ # -- 2.39.5