</div>
</div>
- <div className="project-card-measure smaller-card pull-right" data-key="new_lines">
+ <div className="project-card-measure smaller-card project-card-ncloc" data-key="new_lines">
<div className="project-card-measure-inner">
<div className="project-card-measure-number">
<Measure
import DuplicationsRating from '../../../components/ui/DuplicationsRating';
import SizeRating from '../../../components/ui/SizeRating';
import { translate } from '../../../helpers/l10n';
+import BugIcon from '../../../components/icons-components/BugIcon';
+import CodeSmellIcon from '../../../components/icons-components/CodeSmellIcon';
+import VulnerabilityIcon from '../../../components/icons-components/VulnerabilityIcon';
interface Props {
measures: { [key: string]: string | undefined };
<div className="project-card-measure smaller-card" data-key="reliability_rating">
<div className="project-card-measure-inner">
<div className="project-card-measure-number">
+ <Measure
+ className="spacer-right"
+ measure={{
+ metric: { key: 'bugs', type: 'SHORT_INT' },
+ value: measures['bugs']
+ }}
+ />
<Rating value={measures['reliability_rating']} />
</div>
- <div className="project-card-measure-label">{translate('metric_domain.Reliability')}</div>
+ <div className="project-card-measure-label-with-icon">
+ <BugIcon className="little-spacer-right vertical-bottom" />
+ {translate('metric.bugs.name')}
+ </div>
</div>
</div>
- <div className="project-card-measure smaller-card" data-key="security_rating">
+ <div className="project-card-measure" data-key="security_rating">
<div className="project-card-measure-inner">
<div className="project-card-measure-number">
+ <Measure
+ className="spacer-right"
+ measure={{
+ metric: { key: 'vulnerabilities', type: 'SHORT_INT' },
+ value: measures['vulnerabilities']
+ }}
+ />
<Rating value={measures['security_rating']} />
</div>
- <div className="project-card-measure-label">{translate('metric_domain.Security')}</div>
+ <div className="project-card-measure-label-with-icon">
+ <VulnerabilityIcon className="little-spacer-right vertical-bottom" />
+ {translate('metric.vulnerabilities.name')}
+ </div>
</div>
</div>
<div className="project-card-measure" data-key="sqale_rating">
<div className="project-card-measure-inner">
<div className="project-card-measure-number">
+ <Measure
+ className="spacer-right"
+ measure={{
+ metric: { key: 'code_smells', type: 'SHORT_INT' },
+ value: measures['code_smells']
+ }}
+ />
<Rating value={measures['sqale_rating']} />
</div>
- <div className="project-card-measure-label">
- {translate('metric_domain.Maintainability')}
+ <div className="project-card-measure-label-with-icon">
+ <CodeSmellIcon className="little-spacer-right vertical-bottom" />
+ {translate('metric.code_smells.name')}
</div>
</div>
</div>
</div>
{measures['ncloc'] != null && (
- <div className="project-card-measure pull-right" data-key="ncloc">
+ <div className="project-card-measure project-card-ncloc" data-key="ncloc">
<div className="project-card-measure-inner pull-right">
<div className="project-card-measure-number">
<span className="spacer-right">
it('should render correctly with all data', () => {
const measures = {
alert_status: 'ERROR',
+ bugs: '17',
+ code_smells: '132',
coverage: '88.3',
duplicated_lines_density: '9.8',
ncloc: '2053',
reliability_rating: '1.0',
security_rating: '1.0',
- sqale_rating: '1.0'
+ sqale_rating: '1.0',
+ vulnerabilities: '0'
};
const wrapper = shallow(<ProjectCardOverallMeasures measures={measures} />);
expect(wrapper).toMatchSnapshot();
it('should not render coverage', () => {
const measures = {
alert_status: 'ERROR',
+ bugs: '17',
+ code_smells: '132',
duplicated_lines_density: '9.8',
ncloc: '2053',
reliability_rating: '1.0',
security_rating: '1.0',
- sqale_rating: '1.0'
+ sqale_rating: '1.0',
+ vulnerabilities: '0'
};
const wrapper = shallow(<ProjectCardOverallMeasures measures={measures} />);
expect(wrapper.find('[data-key="coverage"]')).toMatchSnapshot();
it('should not render duplications', () => {
const measures = {
alert_status: 'ERROR',
+ bugs: '17',
+ code_smells: '132',
coverage: '88.3',
ncloc: '2053',
reliability_rating: '1.0',
security_rating: '1.0',
- sqale_rating: '1.0'
+ sqale_rating: '1.0',
+ vulnerabilities: '0'
};
const wrapper = shallow(<ProjectCardOverallMeasures measures={measures} />);
expect(wrapper.find('[data-key="duplicated_lines_density"]')).toMatchSnapshot();
it('should not render ncloc', () => {
const measures = {
alert_status: 'ERROR',
+ bugs: '17',
+ code_smells: '132',
coverage: '88.3',
duplicated_lines_density: '9.8',
reliability_rating: '1.0',
security_rating: '1.0',
- sqale_rating: '1.0'
+ sqale_rating: '1.0',
+ vulnerabilities: '0'
};
const wrapper = shallow(<ProjectCardOverallMeasures measures={measures} />);
expect(wrapper.find('[data-key="ncloc"]').length).toBe(0);
it('should render ncloc correctly', () => {
const measures = {
alert_status: 'ERROR',
+ bugs: '17',
+ code_smells: '132',
coverage: '88.3',
ncloc: '16549887',
duplicated_lines_density: '9.8',
reliability_rating: '1.0',
security_rating: '1.0',
- sqale_rating: '1.0'
+ sqale_rating: '1.0',
+ vulnerabilities: '0'
};
const wrapper = shallow(<ProjectCardOverallMeasures measures={measures} />);
expect(wrapper.find('[data-key="ncloc"]')).toMatchSnapshot();
</div>
</div>
<div
- className="project-card-measure smaller-card pull-right"
+ className="project-card-measure smaller-card project-card-ncloc"
data-key="new_lines"
>
<div
</div>
</div>
<div
- className="project-card-measure smaller-card pull-right"
+ className="project-card-measure smaller-card project-card-ncloc"
data-key="new_lines"
>
<div
<div
className="project-card-measure-number"
>
+ <Measure
+ className="spacer-right"
+ measure={
+ Object {
+ "metric": Object {
+ "key": "bugs",
+ "type": "SHORT_INT",
+ },
+ "value": "17",
+ }
+ }
+ />
<Rating
value="1.0"
/>
</div>
<div
- className="project-card-measure-label"
+ className="project-card-measure-label-with-icon"
>
- metric_domain.Reliability
+ <BugIcon
+ className="little-spacer-right vertical-bottom"
+ />
+ metric.bugs.name
</div>
</div>
</div>
<div
- className="project-card-measure smaller-card"
+ className="project-card-measure"
data-key="security_rating"
>
<div
<div
className="project-card-measure-number"
>
+ <Measure
+ className="spacer-right"
+ measure={
+ Object {
+ "metric": Object {
+ "key": "vulnerabilities",
+ "type": "SHORT_INT",
+ },
+ "value": "0",
+ }
+ }
+ />
<Rating
value="1.0"
/>
</div>
<div
- className="project-card-measure-label"
+ className="project-card-measure-label-with-icon"
>
- metric_domain.Security
+ <VulnerabilityIcon
+ className="little-spacer-right vertical-bottom"
+ />
+ metric.vulnerabilities.name
</div>
</div>
</div>
<div
className="project-card-measure-number"
>
+ <Measure
+ className="spacer-right"
+ measure={
+ Object {
+ "metric": Object {
+ "key": "code_smells",
+ "type": "SHORT_INT",
+ },
+ "value": "132",
+ }
+ }
+ />
<Rating
value="1.0"
/>
</div>
<div
- className="project-card-measure-label"
+ className="project-card-measure-label-with-icon"
>
- metric_domain.Maintainability
+ <CodeSmellIcon
+ className="little-spacer-right vertical-bottom"
+ />
+ metric.code_smells.name
</div>
</div>
</div>
</div>
</div>
<div
- className="project-card-measure pull-right"
+ className="project-card-measure project-card-ncloc"
data-key="ncloc"
>
<div
exports[`should render ncloc correctly 1`] = `
<div
- className="project-card-measure pull-right"
+ className="project-card-measure project-card-ncloc"
data-key="ncloc"
>
<div
import * as React from 'react';
import IssuesFilter from './IssuesFilter';
import { Facet } from '../types';
+import CodeSmellIcon from '../../../components/icons-components/CodeSmellIcon';
+import { translate } from '../../../helpers/l10n';
interface Props {
className?: string;
}
export default function MaintainabilityFilter(props: Props) {
- return <IssuesFilter {...props} name="Maintainability" property="maintainability" />;
+ return (
+ <IssuesFilter
+ {...props}
+ headerDetail={
+ <span className="note little-spacer-left">
+ {'('}
+ <CodeSmellIcon className="little-spacer-right" />
+ {translate('metric.code_smells.name')}
+ {' )'}
+ </span>
+ }
+ name="Maintainability"
+ property="maintainability"
+ />
+ );
}
import * as React from 'react';
import IssuesFilter from './IssuesFilter';
import { Facet } from '../types';
+import BugIcon from '../../../components/icons-components/BugIcon';
+import { translate } from '../../../helpers/l10n';
interface Props {
className?: string;
}
export default function ReliabilityFilter(props: Props) {
- return <IssuesFilter {...props} name="Reliability" property="reliability" />;
+ return (
+ <IssuesFilter
+ {...props}
+ headerDetail={
+ <span className="note little-spacer-left">
+ {'('}
+ <BugIcon className="little-spacer-right" />
+ {translate('metric.bugs.name')}
+ {' )'}
+ </span>
+ }
+ name="Reliability"
+ property="reliability"
+ />
+ );
}
import * as React from 'react';
import IssuesFilter from './IssuesFilter';
import { Facet } from '../types';
+import VulnerabilityIcon from '../../../components/icons-components/VulnerabilityIcon';
+import { translate } from '../../../helpers/l10n';
interface Props {
className?: string;
}
export default function SecurityFilter(props: Props) {
- return <IssuesFilter {...props} name="Security" property="security" />;
+ return (
+ <IssuesFilter
+ {...props}
+ headerDetail={
+ <span className="note little-spacer-left">
+ {'('}
+ <VulnerabilityIcon className="little-spacer-right" />
+ {translate('metric.vulnerabilities.name')}
+ {' )'}
+ </span>
+ }
+ name="Security"
+ property="security"
+ />
+ );
}
exports[`renders 1`] = `
<IssuesFilter
+ headerDetail={
+ <span
+ className="note little-spacer-left"
+ >
+ (
+ <CodeSmellIcon
+ className="little-spacer-right"
+ />
+ metric.code_smells.name
+ )
+ </span>
+ }
name="Maintainability"
property="maintainability"
query={Object {}}
exports[`renders 1`] = `
<IssuesFilter
+ headerDetail={
+ <span
+ className="note little-spacer-left"
+ >
+ (
+ <BugIcon
+ className="little-spacer-right"
+ />
+ metric.bugs.name
+ )
+ </span>
+ }
name="Reliability"
property="reliability"
query={Object {}}
exports[`renders 1`] = `
<IssuesFilter
+ headerDetail={
+ <span
+ className="note little-spacer-left"
+ >
+ (
+ <VulnerabilityIcon
+ className="little-spacer-right"
+ />
+ metric.vulnerabilities.name
+ )
+ </span>
+ }
name="Security"
property="security"
query={Object {}}
}
.project-card-measures {
+ display: flex;
padding-top: 8px;
margin: 0 -15px;
}
.project-card-leak-measures {
+ display: flex;
padding: 8px 0;
margin: 4px -4px;
background-color: #fbf3d5;
content: '';
}
-.project-card-measure.pull-right {
- text-align: right;
-}
-
-.project-card-measure.pull-right:before {
- display: none;
-}
-
-.project-card-measure.pull-right .project-card-measure-inner {
- text-align: right;
-}
-
.project-card-measure .level {
margin-top: 0;
margin-bottom: 0;
font-size: 12px;
}
+.project-card-ncloc {
+ margin-left: auto;
+ text-align: right;
+}
+
+.project-card-ncloc:before {
+ display: none;
+}
+
+.project-card-ncloc .project-card-measure-inner {
+ text-align: right;
+}
+
.project-card-languages {
display: inline-block;
max-width: 120px;
const METRICS = [
'alert_status',
+ 'bugs',
'reliability_rating',
+ 'vulnerabilities',
'security_rating',
+ 'code_smells',
'sqale_rating',
'duplicated_lines_density',
'coverage',