const isFiltered = Object.keys(query).some(key => query[key] != null);
const view = query.view || 'list';
- const visualization = query.visualization || 'quality';
+ const visualization = query.visualization || 'risk';
const top = this.props.organization ? 95 : 30;
];
const METRICS_BY_VISUALIZATION = {
- quality: ['reliability_rating', 'security_rating', 'coverage', 'ncloc', 'sqale_index'],
+ risk: ['reliability_rating', 'security_rating', 'coverage', 'ncloc', 'sqale_index'],
// x, y, size, color
- bugs: ['ncloc', 'reliability_remediation_effort', 'bugs', 'reliability_rating'],
- vulnerabilities: ['ncloc', 'security_remediation_effort', 'vulnerabilities', 'security_rating'],
- code_smells: ['ncloc', 'sqale_index', 'code_smells', 'sqale_rating'],
- uncovered_lines: ['complexity', 'coverage', 'uncovered_lines'],
- duplicated_blocks: ['ncloc', 'duplicated_lines', 'duplicated_blocks']
+ reliability: ['ncloc', 'reliability_remediation_effort', 'bugs', 'reliability_rating'],
+ security: ['ncloc', 'security_remediation_effort', 'vulnerabilities', 'security_rating'],
+ maintainability: ['ncloc', 'sqale_index', 'code_smells', 'sqale_rating'],
+ coverage: ['complexity', 'coverage', 'uncovered_lines'],
+ duplications: ['ncloc', 'duplicated_lines', 'duplicated_blocks']
};
const FACETS = [
const defineMetrics = query => {
if (query.view === 'visualizations') {
- return METRICS_BY_VISUALIZATION[query.visualization || 'quality'];
+ return METRICS_BY_VISUALIZATION[query.visualization || 'risk'];
} else {
return METRICS;
}
export const saveFavorite = () => save(LOCALSTORAGE_FAVORITE);
export const VISUALIZATIONS = [
- 'quality',
- 'bugs',
- 'vulnerabilities',
- 'code_smells',
- 'uncovered_lines',
- 'duplicated_blocks'
+ 'risk',
+ 'reliability',
+ 'security',
+ 'maintainability',
+ 'coverage',
+ 'duplications'
];
export const localizeSorting = (sort?: string) => {
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.
- */
-// @flow
-import React from 'react';
-import SimpleBubbleChart from './SimpleBubbleChart';
-
-export default class Bugs extends React.PureComponent {
- render() {
- return (
- <SimpleBubbleChart
- {...this.props}
- xMetric={{ key: 'ncloc', type: 'SHORT_INT' }}
- yMetric={{ key: 'reliability_remediation_effort', type: 'SHORT_WORK_DUR' }}
- sizeMetric={{ key: 'bugs', type: 'SHORT_INT' }}
- colorMetric="reliability_rating"
- />
- );
- }
-}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.
- */
-// @flow
-import React from 'react';
-import SimpleBubbleChart from './SimpleBubbleChart';
-
-export default class CodeSmells extends React.PureComponent {
- render() {
- return (
- <SimpleBubbleChart
- {...this.props}
- xMetric={{ key: 'ncloc', type: 'SHORT_INT' }}
- yMetric={{ key: 'sqale_index', type: 'SHORT_WORK_DUR' }}
- sizeMetric={{ key: 'code_smells', type: 'SHORT_INT' }}
- colorMetric="sqale_rating"
- />
- );
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.
+ */
+// @flow
+import React from 'react';
+import SimpleBubbleChart from './SimpleBubbleChart';
+
+export default class Coverage extends React.PureComponent {
+ render() {
+ return (
+ <SimpleBubbleChart
+ {...this.props}
+ xMetric={{ key: 'complexity', type: 'SHORT_INT' }}
+ yMetric={{ key: 'coverage', type: 'PERCENT' }}
+ yDomain={[100, 0]}
+ sizeMetric={{ key: 'uncovered_lines', type: 'SHORT_INT' }}
+ />
+ );
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.
- */
-// @flow
-import React from 'react';
-import SimpleBubbleChart from './SimpleBubbleChart';
-
-export default class DuplicatedBlocks extends React.PureComponent {
- render() {
- return (
- <SimpleBubbleChart
- {...this.props}
- xMetric={{ key: 'ncloc', type: 'SHORT_INT' }}
- yMetric={{ key: 'duplicated_lines', type: 'SHORT_INT' }}
- sizeMetric={{ key: 'duplicated_blocks', type: 'SHORT_INT' }}
- />
- );
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.
+ */
+// @flow
+import React from 'react';
+import SimpleBubbleChart from './SimpleBubbleChart';
+
+export default class Duplications extends React.PureComponent {
+ render() {
+ return (
+ <SimpleBubbleChart
+ {...this.props}
+ xMetric={{ key: 'ncloc', type: 'SHORT_INT' }}
+ yMetric={{ key: 'duplicated_lines', type: 'SHORT_INT' }}
+ sizeMetric={{ key: 'duplicated_blocks', type: 'SHORT_INT' }}
+ />
+ );
+ }
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.
+ */
+// @flow
+import React from 'react';
+import SimpleBubbleChart from './SimpleBubbleChart';
+
+export default class Maintainability extends React.PureComponent {
+ render() {
+ return (
+ <SimpleBubbleChart
+ {...this.props}
+ xMetric={{ key: 'ncloc', type: 'SHORT_INT' }}
+ yMetric={{ key: 'sqale_index', type: 'SHORT_WORK_DUR' }}
+ sizeMetric={{ key: 'code_smells', type: 'SHORT_INT' }}
+ colorMetric="sqale_rating"
+ />
+ );
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.
- */
-// @flow
-import React from 'react';
-import BubbleChart from '../../../components/charts/BubbleChart';
-import { formatMeasure } from '../../../helpers/measures';
-import { translate, translateWithParameters } from '../../../helpers/l10n';
-import { RATING_COLORS } from '../../../helpers/constants';
-import { getProjectUrl } from '../../../helpers/urls';
-
-type Project = {
- key: string,
- measures: { [string]: string },
- name: string,
- organization?: { name: string }
-};
-
-const X_METRIC = 'sqale_index';
-const X_METRIC_TYPE = 'SHORT_WORK_DUR';
-const Y_METRIC = 'coverage';
-const Y_METRIC_TYPE = 'PERCENT';
-const SIZE_METRIC = 'ncloc';
-const SIZE_METRIC_TYPE = 'SHORT_INT';
-const COLOR_METRIC_1 = 'reliability_rating';
-const COLOR_METRIC_2 = 'security_rating';
-const COLOR_METRIC_TYPE = 'RATING';
-
-export default class QualityModel extends React.PureComponent {
- props: {
- displayOrganizations: boolean,
- projects: Array<Project>
- };
-
- getMetricTooltip(metric: { key: string, type: string }, value: ?number) {
- const name = translate('metric', metric.key, 'name');
- const formattedValue = value != null ? formatMeasure(value, metric.type) : '–';
- return `<div>${name}: ${formattedValue}</div>`;
- }
-
- getTooltip(
- project: Project,
- x: ?number,
- y: ?number,
- size: ?number,
- color1: ?number,
- color2: ?number
- ) {
- const fullProjectName = this.props.displayOrganizations && project.organization
- ? `${project.organization.name} / <strong>${project.name}</strong>`
- : `<strong>${project.name}</strong>`;
- const inner = [
- `<div class="little-spacer-bottom">${fullProjectName}</div>`,
- this.getMetricTooltip({ key: COLOR_METRIC_1, type: COLOR_METRIC_TYPE }, color1),
- this.getMetricTooltip({ key: COLOR_METRIC_2, type: COLOR_METRIC_TYPE }, color2),
- this.getMetricTooltip({ key: Y_METRIC, type: Y_METRIC_TYPE }, y),
- this.getMetricTooltip({ key: X_METRIC, type: X_METRIC_TYPE }, x),
- this.getMetricTooltip({ key: SIZE_METRIC, type: SIZE_METRIC_TYPE }, size)
- ].join('');
- return `<div class="text-left">${inner}</div>`;
- }
-
- render() {
- const items = this.props.projects.map(project => {
- const x = project.measures[X_METRIC] != null ? Number(project.measures[X_METRIC]) : null;
- const y = project.measures[Y_METRIC] != null ? Number(project.measures[Y_METRIC]) : null;
- const size = project.measures[SIZE_METRIC] != null
- ? Number(project.measures[SIZE_METRIC])
- : null;
- const color1 = project.measures[COLOR_METRIC_1] != null
- ? Number(project.measures[COLOR_METRIC_1])
- : null;
- const color2 = project.measures[COLOR_METRIC_2] != null
- ? Number(project.measures[COLOR_METRIC_2])
- : null;
- return {
- x: x || 0,
- y: y || 0,
- size: size || 0,
- color: color1 != null && color2 != null
- ? RATING_COLORS[Math.max(color1, color2) - 1]
- : undefined,
- key: project.key,
- tooltip: this.getTooltip(project, x, y, size, color1, color2),
- link: getProjectUrl(project.key)
- };
- });
- const formatXTick = tick => formatMeasure(tick, X_METRIC_TYPE);
- const formatYTick = tick => formatMeasure(tick, Y_METRIC_TYPE);
- return (
- <div>
- <BubbleChart
- formatXTick={formatXTick}
- formatYTick={formatYTick}
- height={600}
- items={items}
- padding={[40, 20, 60, 100]}
- yDomain={[100, 0]}
- />
- <div className="measure-details-bubble-chart-axis x">
- {translate('metric', X_METRIC, 'name')}
- </div>
- <div className="measure-details-bubble-chart-axis y">
- {translate('metric', Y_METRIC, 'name')}
- </div>
- <div className="measure-details-bubble-chart-axis size">
- <span className="spacer-right">
- {translateWithParameters(
- 'component_measures.legend.color_x',
- translate('projects.worse_of_reliablity_and_security')
- )}
- </span>
- {translateWithParameters(
- 'component_measures.legend.size_x',
- translate('metric', SIZE_METRIC, 'name')
- )}
- </div>
- </div>
- );
- }
-}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.
+ */
+// @flow
+import React from 'react';
+import SimpleBubbleChart from './SimpleBubbleChart';
+
+export default class Reliability extends React.PureComponent {
+ render() {
+ return (
+ <SimpleBubbleChart
+ {...this.props}
+ xMetric={{ key: 'ncloc', type: 'SHORT_INT' }}
+ yMetric={{ key: 'reliability_remediation_effort', type: 'SHORT_WORK_DUR' }}
+ sizeMetric={{ key: 'bugs', type: 'SHORT_INT' }}
+ colorMetric="reliability_rating"
+ />
+ );
+ }
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.
+ */
+// @flow
+import React from 'react';
+import BubbleChart from '../../../components/charts/BubbleChart';
+import { formatMeasure } from '../../../helpers/measures';
+import { translate, translateWithParameters } from '../../../helpers/l10n';
+import { RATING_COLORS } from '../../../helpers/constants';
+import { getProjectUrl } from '../../../helpers/urls';
+
+type Project = {
+ key: string,
+ measures: { [string]: string },
+ name: string,
+ organization?: { name: string }
+};
+
+const X_METRIC = 'sqale_index';
+const X_METRIC_TYPE = 'SHORT_WORK_DUR';
+const Y_METRIC = 'coverage';
+const Y_METRIC_TYPE = 'PERCENT';
+const SIZE_METRIC = 'ncloc';
+const SIZE_METRIC_TYPE = 'SHORT_INT';
+const COLOR_METRIC_1 = 'reliability_rating';
+const COLOR_METRIC_2 = 'security_rating';
+const COLOR_METRIC_TYPE = 'RATING';
+
+export default class Risk extends React.PureComponent {
+ props: {
+ displayOrganizations: boolean,
+ projects: Array<Project>
+ };
+
+ getMetricTooltip(metric: { key: string, type: string }, value: ?number) {
+ const name = translate('metric', metric.key, 'name');
+ const formattedValue = value != null ? formatMeasure(value, metric.type) : '–';
+ return `<div>${name}: ${formattedValue}</div>`;
+ }
+
+ getTooltip(
+ project: Project,
+ x: ?number,
+ y: ?number,
+ size: ?number,
+ color1: ?number,
+ color2: ?number
+ ) {
+ const fullProjectName = this.props.displayOrganizations && project.organization
+ ? `${project.organization.name} / <strong>${project.name}</strong>`
+ : `<strong>${project.name}</strong>`;
+ const inner = [
+ `<div class="little-spacer-bottom">${fullProjectName}</div>`,
+ this.getMetricTooltip({ key: COLOR_METRIC_1, type: COLOR_METRIC_TYPE }, color1),
+ this.getMetricTooltip({ key: COLOR_METRIC_2, type: COLOR_METRIC_TYPE }, color2),
+ this.getMetricTooltip({ key: Y_METRIC, type: Y_METRIC_TYPE }, y),
+ this.getMetricTooltip({ key: X_METRIC, type: X_METRIC_TYPE }, x),
+ this.getMetricTooltip({ key: SIZE_METRIC, type: SIZE_METRIC_TYPE }, size)
+ ].join('');
+ return `<div class="text-left">${inner}</div>`;
+ }
+
+ render() {
+ const items = this.props.projects.map(project => {
+ const x = project.measures[X_METRIC] != null ? Number(project.measures[X_METRIC]) : null;
+ const y = project.measures[Y_METRIC] != null ? Number(project.measures[Y_METRIC]) : null;
+ const size = project.measures[SIZE_METRIC] != null
+ ? Number(project.measures[SIZE_METRIC])
+ : null;
+ const color1 = project.measures[COLOR_METRIC_1] != null
+ ? Number(project.measures[COLOR_METRIC_1])
+ : null;
+ const color2 = project.measures[COLOR_METRIC_2] != null
+ ? Number(project.measures[COLOR_METRIC_2])
+ : null;
+ return {
+ x: x || 0,
+ y: y || 0,
+ size: size || 0,
+ color: color1 != null && color2 != null
+ ? RATING_COLORS[Math.max(color1, color2) - 1]
+ : undefined,
+ key: project.key,
+ tooltip: this.getTooltip(project, x, y, size, color1, color2),
+ link: getProjectUrl(project.key)
+ };
+ });
+ const formatXTick = tick => formatMeasure(tick, X_METRIC_TYPE);
+ const formatYTick = tick => formatMeasure(tick, Y_METRIC_TYPE);
+ return (
+ <div>
+ <BubbleChart
+ formatXTick={formatXTick}
+ formatYTick={formatYTick}
+ height={600}
+ items={items}
+ padding={[40, 20, 60, 100]}
+ yDomain={[100, 0]}
+ />
+ <div className="measure-details-bubble-chart-axis x">
+ {translate('metric', X_METRIC, 'name')}
+ </div>
+ <div className="measure-details-bubble-chart-axis y">
+ {translate('metric', Y_METRIC, 'name')}
+ </div>
+ <div className="measure-details-bubble-chart-axis size">
+ <span className="spacer-right">
+ {translateWithParameters(
+ 'component_measures.legend.color_x',
+ translate('projects.worse_of_reliablity_and_security')
+ )}
+ </span>
+ {translateWithParameters(
+ 'component_measures.legend.size_x',
+ translate('metric', SIZE_METRIC, 'name')
+ )}
+ </div>
+ </div>
+ );
+ }
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info 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.
+ */
+// @flow
+import React from 'react';
+import SimpleBubbleChart from './SimpleBubbleChart';
+
+export default class Security extends React.PureComponent {
+ render() {
+ return (
+ <SimpleBubbleChart
+ {...this.props}
+ xMetric={{ key: 'ncloc', type: 'SHORT_INT' }}
+ yMetric={{ key: 'security_remediation_effort', type: 'SHORT_WORK_DUR' }}
+ sizeMetric={{ key: 'vulnerabilities', type: 'SHORT_INT' }}
+ colorMetric="security_rating"
+ />
+ );
+ }
+}
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.
- */
-// @flow
-import React from 'react';
-import SimpleBubbleChart from './SimpleBubbleChart';
-
-export default class UncoveredLines extends React.PureComponent {
- render() {
- return (
- <SimpleBubbleChart
- {...this.props}
- xMetric={{ key: 'complexity', type: 'SHORT_INT' }}
- yMetric={{ key: 'coverage', type: 'PERCENT' }}
- yDomain={[100, 0]}
- sizeMetric={{ key: 'uncovered_lines', type: 'SHORT_INT' }}
- />
- );
- }
-}
// @flow
import React from 'react';
import VisualizationsHeader from './VisualizationsHeader';
-import QualityModel from './QualityModel';
-import Bugs from './Bugs';
-import Vulnerabilities from './Vulnerabilities';
-import CodeSmells from './CodeSmells';
-import UncoveredLines from './UncoveredLines';
-import DuplicatedBlocks from './DuplicatedBlocks';
+import Risk from './Risk';
+import Reliability from './Reliability';
+import Security from './Security';
+import Maintainability from './Maintainability';
+import Coverage from './Coverage';
+import Duplications from './Duplications';
import { localizeSorting } from '../utils';
import { translate, translateWithParameters } from '../../../helpers/l10n';
renderVisualization(projects: Array<*>) {
const visualizationToComponent = {
- quality: QualityModel,
- bugs: Bugs,
- vulnerabilities: Vulnerabilities,
- code_smells: CodeSmells,
- uncovered_lines: UncoveredLines,
- duplicated_blocks: DuplicatedBlocks
+ risk: Risk,
+ reliability: Reliability,
+ security: Security,
+ maintainability: Maintainability,
+ coverage: Coverage,
+ duplications: Duplications
};
const Component = visualizationToComponent[this.props.visualization];
render() {
const options = VISUALIZATIONS.map(option => ({
value: option,
- label: option === 'quality'
- ? translate('projects.quality_model')
- : translate('metric', option, 'name')
+ label: translate('projects.visualization', option)
}));
return (
+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2017 SonarSource SA
- * mailto:info 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.
- */
-// @flow
-import React from 'react';
-import SimpleBubbleChart from './SimpleBubbleChart';
-
-export default class Vulnerabilities extends React.PureComponent {
- render() {
- return (
- <SimpleBubbleChart
- {...this.props}
- xMetric={{ key: 'ncloc', type: 'SHORT_INT' }}
- yMetric={{ key: 'security_remediation_effort', type: 'SHORT_WORK_DUR' }}
- sizeMetric={{ key: 'vulnerabilities', type: 'SHORT_INT' }}
- colorMetric="security_rating"
- />
- );
- }
-}
projects.sort_list=Sort list by
projects.view.list=List
projects.view.visualizations=Visualizations
-projects.quality_model=Quality Model
projects.worse_of_reliablity_and_security=Worse of Reliability and Security
-projects.visualization.quality.description=Get quick insights into the operational risks in your projects. Any color but green indicates immediate risks: Bugs or Vulnerabilities that should be examined. A position at the top or right of the graph means that the longer-term health of the project may be at risk. Small green bubbles at the bottom-left are best.
-projects.visualization.bugs.description=See bugs' operational risks to your projects. The closer a bubble's color is to red, the more severe the worst bugs in the project. Bubble size indicates bug volume in the project, and each bubble's vertical position reflects the estimated time to address the bugs in the project. Small green bubbles on the bottom edge are best.
-projects.visualization.vulnerabilities.description=See vulnerabilities' operational risks to your projects. The closer a bubble's color is to red, the more severe the worst vulnerabilities in the project. Bubble size indicates vulnerability volume in the project, and each bubble's vertical position reflects the estimated time to address the vulnerabilities in the project. Small green bubbles on the bottom edge are best.
-projects.visualization.code_smells.description=See code smells' long-term risks to your projects. The closer a bubble's color is to red, the higher the ratio of technical debt to project size. Bubble size indicates code smell volume in the project, and each bubble's vertical position reflects the estimated time to address the code smells in the project. Small green bubbles on the bottom edge are best.
-projects.visualization.uncovered_lines.description=See missing test coverage's long-term risks to your projects. Bubble size indicates the volume of uncovered lines in the project, and each bubble's vertical position reflects the volume of missing coverage. Small bubbles on the bottom edge are best.
-projects.visualization.duplicated_blocks.description=See duplications' long-term risks to your projects. Bubble size indicates the volume of duplicated blocks in the project, and each bubble's vertical position reflects the volume of lines in those blocks. Small bubbles on the bottom edge are best.
+projects.visualization.risk=Risk
+projects.visualization.risk.description=Get quick insights into the operational risks in your projects. Any color but green indicates immediate risks: Bugs or Vulnerabilities that should be examined. A position at the top or right of the graph means that the longer-term health of the project may be at risk. Small green bubbles at the bottom-left are best.
+projects.visualization.reliability=Reliability
+projects.visualization.reliability.description=See bugs' operational risks to your projects. The closer a bubble's color is to red, the more severe the worst bugs in the project. Bubble size indicates bug volume in the project, and each bubble's vertical position reflects the estimated time to address the bugs in the project. Small green bubbles on the bottom edge are best.
+projects.visualization.security=Security
+projects.visualization.security.description=See vulnerabilities' operational risks to your projects. The closer a bubble's color is to red, the more severe the worst vulnerabilities in the project. Bubble size indicates vulnerability volume in the project, and each bubble's vertical position reflects the estimated time to address the vulnerabilities in the project. Small green bubbles on the bottom edge are best.
+projects.visualization.maintainability=Maintainability
+projects.visualization.maintainability.description=See code smells' long-term risks to your projects. The closer a bubble's color is to red, the higher the ratio of technical debt to project size. Bubble size indicates code smell volume in the project, and each bubble's vertical position reflects the estimated time to address the code smells in the project. Small green bubbles on the bottom edge are best.
+projects.visualization.coverage=Coverage
+projects.visualization.coverage.description=See missing test coverage's long-term risks to your projects. Bubble size indicates the volume of uncovered lines in the project, and each bubble's vertical position reflects the volume of missing coverage. Small bubbles on the bottom edge are best.
+projects.visualization.duplications=Duplications
+projects.visualization.duplications.description=See duplications' long-term risks to your projects. Bubble size indicates the volume of duplicated blocks in the project, and each bubble's vertical position reflects the volume of lines in those blocks. Small bubbles on the bottom edge are best.
projects.limited_set_of_projects=Displayed project set limited to the top {0} projects based on current sort: {1}.
projects.sort.name=by name
projects.sort.reliability=by reliability (best first)