</tr>
<tr>
<td>open</td>
- <td>/sonar/overview/tests?id=project-for-overview-it-coverage</td>
+ <td>/sonar/overview/coverage?id=project-for-overview-it-coverage</td>
<td></td>
</tr>
<tr>
</tr>
<tr>
<td>open</td>
- <td>/sonar/overview/tests?id=project-for-overview-overall-coverage</td>
+ <td>/sonar/overview/coverage?id=project-for-overview-overall-coverage</td>
<td></td>
</tr>
<tr>
</tr>
<tr>
<td>open</td>
- <td>/sonar/overview/tests?id=project-for-overview-ut-coverage</td>
+ <td>/sonar/overview/coverage?id=project-for-overview-ut-coverage</td>
<td></td>
</tr>
<tr>
'critical_violations', 'major_violations', 'minor_violations', 'info_violations', 'confirmed_issues'];
-export const IssuesMain = React.createClass({
+export const DebtMain = React.createClass({
mixins: [TooltipsMixin],
getInitialState() {
+++ /dev/null
-import React from 'react';
-
-import { LanguageDistribution } from './../components/language-distribution';
-import { ComplexityDistribution } from './../components/complexity-distribution';
-import { NclocDistribution } from '../components/ncloc-distribution';
-import { getMeasuresAndVariations } 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';
-
-
-export const SizeMain = 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, 'value');
- let leak = this.getMeasuresValues(r, 'var' + this.props.leakPeriodIndex);
- this.setState({ ready: true, measures, leak });
- });
- },
-
- getMeasuresValues (measures, fieldKey) {
- let values = {};
- Object.keys(measures).forEach(measureKey => {
- values[measureKey] = measures[measureKey][fieldKey];
- });
- 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 getMeasuresAndVariations(this.props.component.key, this.getMetricsForDomain());
- },
-
- renderLoading () {
- return <div className="text-center">
- <i className="spinner spinner-margin"/>
- </div>;
- },
-
- renderLegend () {
- return <DomainLeakTitle inline={true} label={this.state.leakPeriodLabel} date={this.state.leakPeriodDate}/>;
- },
-
- renderOtherMeasures(domain, hiddenMetrics) {
- let metrics = filterMetricsForDomains(this.props.metrics, [domain])
- .filter(metric => hiddenMetrics.indexOf(metric.key) === -1)
- .map(metric => {
- return <DetailedMeasure key={metric.key}
- {...this.props}
- {...this.state}
- metric={metric.key}
- type={metric.type}/>;
- });
- return <div>{metrics}</div>;
- },
-
- 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 <LanguageDistribution lines={this.state.measures['ncloc']} distribution={distribution}/>;
- },
-
- renderComplexityDistribution(distribution, props) {
- if (distribution == null) {
- return null;
- }
- return <ComplexityDistribution distribution={distribution} {...props}/>;
- },
-
- renderComplexityCard() {
- if (this.state.measures['complexity'] == null) {
- return null;
- }
-
- return <div className="overview-detailed-layout-column">
- <div className="overview-detailed-measures-list">
- <DetailedMeasure {...this.props}
- {...this.state}
- metric="complexity"
- type="INT"/>
- <DetailedMeasure {...this.props}
- {...this.state}
- metric="function_complexity"
- type="FLOAT">
- {this.renderComplexityDistribution(this.state.measures['function_complexity_distribution'],
- { of: 'function' })}
- </DetailedMeasure>
- <DetailedMeasure {...this.props}
- {...this.state}
- metric="file_complexity"
- type="FLOAT">
- {this.renderComplexityDistribution(this.state.measures['file_complexity_distribution'],
- { of: 'file' })}
- </DetailedMeasure>
- <DetailedMeasure {...this.props}
- {...this.state}
- metric="class_complexity"
- type="FLOAT"/>
- {this.renderOtherComplexityMeasures()}
- </div>
- </div>;
- },
-
- render () {
- if (!this.state.ready) {
- return this.renderLoading();
- }
- return <div className="overview-detailed-page">
- <div className="overview-card">
- <div className="overview-card-header">
- <div className="overview-title">{window.t('overview.domain.size')}</div>
- {this.renderLegend()}
- </div>
-
- <div className="overview-detailed-layout-size">
- <div className="overview-detailed-layout-column">
- <div className="overview-detailed-measures-list">
- <DetailedMeasure {...this.props}
- {...this.state}
- metric="ncloc"
- type="INT">
- {this.renderLanguageDistribution()}
- </DetailedMeasure>
- {this.renderOtherSizeMeasures()}
- </div>
- </div>
-
- {this.renderComplexityCard()}
-
- <div className="overview-detailed-layout-column">
- <div className="overview-detailed-measures-list">
- {this.renderOtherDocumentationMeasures()}
- </div>
- </div>
- </div>
- </div>
-
- <div className="overview-cards-list">
- <div className="overview-card">
- <DomainTimeline {...this.props} {...this.state}
- initialMetric="ncloc"
- metrics={this.getMetricsForTimeline()}
- allMetrics={this.getAllMetricsForTimeline()}/>
- </div>
- <div className="overview-card">
- <NclocDistribution {...this.props}/>
- </div>
- </div>
- </div>;
-
- }
-});
--- /dev/null
+import React from 'react';
+
+import { LanguageDistribution } from './../components/language-distribution';
+import { ComplexityDistribution } from './../components/complexity-distribution';
+import { NclocDistribution } from '../components/ncloc-distribution';
+import { getMeasuresAndVariations } 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';
+
+
+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, 'value');
+ let leak = this.getMeasuresValues(r, 'var' + this.props.leakPeriodIndex);
+ this.setState({ ready: true, measures, leak });
+ });
+ },
+
+ getMeasuresValues (measures, fieldKey) {
+ let values = {};
+ Object.keys(measures).forEach(measureKey => {
+ values[measureKey] = measures[measureKey][fieldKey];
+ });
+ 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 getMeasuresAndVariations(this.props.component.key, this.getMetricsForDomain());
+ },
+
+ renderLoading () {
+ return <div className="text-center">
+ <i className="spinner spinner-margin"/>
+ </div>;
+ },
+
+ renderLegend () {
+ return <DomainLeakTitle inline={true} label={this.state.leakPeriodLabel} date={this.state.leakPeriodDate}/>;
+ },
+
+ renderOtherMeasures(domain, hiddenMetrics) {
+ let metrics = filterMetricsForDomains(this.props.metrics, [domain])
+ .filter(metric => hiddenMetrics.indexOf(metric.key) === -1)
+ .map(metric => {
+ return <DetailedMeasure key={metric.key}
+ {...this.props}
+ {...this.state}
+ metric={metric.key}
+ type={metric.type}/>;
+ });
+ return <div>{metrics}</div>;
+ },
+
+ 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 <LanguageDistribution lines={this.state.measures['ncloc']} distribution={distribution}/>;
+ },
+
+ renderComplexityDistribution(distribution, props) {
+ if (distribution == null) {
+ return null;
+ }
+ return <ComplexityDistribution distribution={distribution} {...props}/>;
+ },
+
+ renderComplexityCard() {
+ if (this.state.measures['complexity'] == null) {
+ return null;
+ }
+
+ return <div className="overview-detailed-layout-column">
+ <div className="overview-detailed-measures-list">
+ <DetailedMeasure {...this.props}
+ {...this.state}
+ metric="complexity"
+ type="INT"/>
+ <DetailedMeasure {...this.props}
+ {...this.state}
+ metric="function_complexity"
+ type="FLOAT">
+ {this.renderComplexityDistribution(this.state.measures['function_complexity_distribution'],
+ { of: 'function' })}
+ </DetailedMeasure>
+ <DetailedMeasure {...this.props}
+ {...this.state}
+ metric="file_complexity"
+ type="FLOAT">
+ {this.renderComplexityDistribution(this.state.measures['file_complexity_distribution'],
+ { of: 'file' })}
+ </DetailedMeasure>
+ <DetailedMeasure {...this.props}
+ {...this.state}
+ metric="class_complexity"
+ type="FLOAT"/>
+ {this.renderOtherComplexityMeasures()}
+ </div>
+ </div>;
+ },
+
+ render () {
+ if (!this.state.ready) {
+ return this.renderLoading();
+ }
+ return <div className="overview-detailed-page">
+ <div className="overview-card">
+ <div className="overview-card-header">
+ <div className="overview-title">{window.t('overview.domain.structure')}</div>
+ {this.renderLegend()}
+ </div>
+
+ <div className="overview-detailed-layout-size">
+ <div className="overview-detailed-layout-column">
+ <div className="overview-detailed-measures-list">
+ <DetailedMeasure {...this.props}
+ {...this.state}
+ metric="ncloc"
+ type="INT">
+ {this.renderLanguageDistribution()}
+ </DetailedMeasure>
+ {this.renderOtherSizeMeasures()}
+ </div>
+ </div>
+
+ {this.renderComplexityCard()}
+
+ <div className="overview-detailed-layout-column">
+ <div className="overview-detailed-measures-list">
+ {this.renderOtherDocumentationMeasures()}
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div className="overview-cards-list">
+ <div className="overview-card">
+ <DomainTimeline {...this.props} {...this.state}
+ initialMetric="ncloc"
+ metrics={this.getMetricsForTimeline()}
+ allMetrics={this.getAllMetricsForTimeline()}/>
+ </div>
+ <div className="overview-card">
+ <NclocDistribution {...this.props}/>
+ </div>
+ </div>
+ </div>;
+
+ }
+});
];
return <Domain>
- <DomainHeader component={this.props.component} title={window.t('overview.domain.coverage')} linkTo="/tests"/>
+ <DomainHeader component={this.props.component}
+ title={window.t('overview.domain.coverage')}
+ linkTo="/coverage"/>
- <DomainPanel domain="coverage">
+ <DomainPanel>
<DomainNutshell>
<MeasuresList>
--- /dev/null
+import moment from 'moment';
+import React from 'react';
+
+import { Domain,
+ DomainHeader,
+ DomainPanel,
+ DomainNutshell,
+ DomainLeak,
+ MeasuresList,
+ Measure,
+ DomainMixin } from './components';
+import { Rating } from './../../../components/shared/rating';
+import { IssuesLink } from '../../../components/shared/issues-link';
+import { DrilldownLink } from '../../../components/shared/drilldown-link';
+import { TooltipsMixin } from '../../../components/mixins/tooltips-mixin';
+import { Legend } from '../components/legend';
+import { getMetricName } from '../helpers/metrics';
+import { formatMeasure } from '../../../helpers/measures';
+
+
+export const GeneralDebt = React.createClass({
+ propTypes: {
+ leakPeriodLabel: React.PropTypes.string,
+ leakPeriodDate: React.PropTypes.object
+ },
+
+ mixins: [TooltipsMixin, DomainMixin],
+
+ renderLeak () {
+ if (!this.hasLeakPeriod()) {
+ return null;
+ }
+
+ let createdAfter = moment(this.props.leakPeriodDate).format('YYYY-MM-DDTHH:mm:ssZZ');
+
+ return <DomainLeak>
+ <Legend leakPeriodLabel={this.props.leakPeriodLabel} leakPeriodDate={this.props.leakPeriodDate}/>
+
+ <MeasuresList>
+ <Measure label={getMetricName('new_debt')}>
+ <IssuesLink component={this.props.component.key}
+ params={{ resolved: 'false', createdAfter: createdAfter, facetMode: 'debt' }}>
+ {formatMeasure(this.props.leak.debt, 'SHORT_WORK_DUR')}
+ </IssuesLink>
+ </Measure>
+ <Measure label={getMetricName('new_issues')}>
+ <IssuesLink component={this.props.component.key}
+ params={{ resolved: 'false', createdAfter: createdAfter }}>
+ {formatMeasure(this.props.leak.issues, 'SHORT_INT')}
+ </IssuesLink>
+ </Measure>
+ </MeasuresList>
+ {this.renderTimeline('after')}
+ </DomainLeak>;
+ },
+
+ render () {
+ return <Domain>
+ <DomainHeader component={this.props.component}
+ title={window.t('overview.domain.debt')}
+ linkTo="/debt"/>
+
+ <DomainPanel>
+ <DomainNutshell>
+ <MeasuresList>
+
+ <Measure composite={true}>
+ <div className="display-inline-block text-middle big-spacer-right">
+ <div className="overview-domain-measure-value">
+ <DrilldownLink component={this.props.component.key} metric="sqale_rating">
+ <Rating value={this.props.measures['sqale_rating']}/>
+ </DrilldownLink>
+ </div>
+ </div>
+ <div className="display-inline-block text-middle">
+ <div className="overview-domain-measure-value">
+ <IssuesLink component={this.props.component.key}
+ params={{ resolved: 'false', facetMode: 'debt' }}>
+ {formatMeasure(this.props.measures.debt, 'SHORT_WORK_DUR')}
+ </IssuesLink>
+ </div>
+ <div className="overview-domain-measure-label">{getMetricName('debt')}</div>
+ </div>
+ </Measure>
+
+ <Measure label={getMetricName('issues')}>
+ <IssuesLink component={this.props.component.key} params={{ resolved: 'false' }}>
+ {formatMeasure(this.props.measures.issues, 'SHORT_INT')}
+ </IssuesLink>
+ </Measure>
+ </MeasuresList>
+ {this.renderTimeline('before', true)}
+ </DomainNutshell>
+ {this.renderLeak()}
+ </DomainPanel>
+ </Domain>;
+ }
+});
];
return <Domain>
- <DomainHeader component={this.props.component} title={window.t('overview.domain.duplications')}
+ <DomainHeader component={this.props.component}
+ title={window.t('overview.domain.duplications')}
linkTo="/duplications"/>
- <DomainPanel domain="duplications">
+ <DomainPanel>
<DomainNutshell>
<MeasuresList>
+++ /dev/null
-import moment from 'moment';
-import React from 'react';
-
-import { Domain,
- DomainHeader,
- DomainPanel,
- DomainNutshell,
- DomainLeak,
- MeasuresList,
- Measure,
- DomainMixin } from './components';
-import { Rating } from './../../../components/shared/rating';
-import { IssuesLink } from '../../../components/shared/issues-link';
-import { DrilldownLink } from '../../../components/shared/drilldown-link';
-import { TooltipsMixin } from '../../../components/mixins/tooltips-mixin';
-import { Legend } from '../components/legend';
-import { getMetricName } from '../helpers/metrics';
-import { formatMeasure } from '../../../helpers/measures';
-
-
-export const GeneralIssues = React.createClass({
- propTypes: {
- leakPeriodLabel: React.PropTypes.string,
- leakPeriodDate: React.PropTypes.object
- },
-
- mixins: [TooltipsMixin, DomainMixin],
-
- renderLeak () {
- if (!this.hasLeakPeriod()) {
- return null;
- }
-
- let createdAfter = moment(this.props.leakPeriodDate).format('YYYY-MM-DDTHH:mm:ssZZ');
-
- return <DomainLeak>
- <Legend leakPeriodLabel={this.props.leakPeriodLabel} leakPeriodDate={this.props.leakPeriodDate}/>
-
- <MeasuresList>
- <Measure label={getMetricName('new_debt')}>
- <IssuesLink component={this.props.component.key}
- params={{ resolved: 'false', createdAfter: createdAfter, facetMode: 'debt' }}>
- {formatMeasure(this.props.leak.debt, 'SHORT_WORK_DUR')}
- </IssuesLink>
- </Measure>
- <Measure label={getMetricName('new_issues')}>
- <IssuesLink component={this.props.component.key}
- params={{ resolved: 'false', createdAfter: createdAfter }}>
- {formatMeasure(this.props.leak.issues, 'SHORT_INT')}
- </IssuesLink>
- </Measure>
- </MeasuresList>
- {this.renderTimeline('after')}
- </DomainLeak>;
- },
-
- render () {
- return <Domain>
- <DomainHeader component={this.props.component} title={window.t('overview.domain.debt')} linkTo="/issues"/>
-
- <DomainPanel domain="issues">
- <DomainNutshell>
- <MeasuresList>
-
- <Measure composite={true}>
- <div className="display-inline-block text-middle big-spacer-right">
- <div className="overview-domain-measure-value">
- <DrilldownLink component={this.props.component.key} metric="sqale_rating">
- <Rating value={this.props.measures['sqale_rating']}/>
- </DrilldownLink>
- </div>
- </div>
- <div className="display-inline-block text-middle">
- <div className="overview-domain-measure-value">
- <IssuesLink component={this.props.component.key}
- params={{ resolved: 'false', facetMode: 'debt' }}>
- {formatMeasure(this.props.measures.debt, 'SHORT_WORK_DUR')}
- </IssuesLink>
- </div>
- <div className="overview-domain-measure-label">{getMetricName('debt')}</div>
- </div>
- </Measure>
-
- <Measure label={getMetricName('issues')}>
- <IssuesLink component={this.props.component.key} params={{ resolved: 'false' }}>
- {formatMeasure(this.props.measures.issues, 'SHORT_INT')}
- </IssuesLink>
- </Measure>
- </MeasuresList>
- {this.renderTimeline('before', true)}
- </DomainNutshell>
- {this.renderLeak()}
- </DomainPanel>
- </Domain>;
- }
-});
import moment from 'moment';
import React from 'react';
-import { GeneralIssues } from './issues';
+import { GeneralDebt } from './debt';
import { GeneralCoverage } from './coverage';
import { GeneralDuplications } from './duplications';
-import { GeneralSize } from './size';
+import { GeneralStructure } from './structure';
import { CoverageSelectionMixin } from '../components/coverage-selection-mixin';
import { getPeriodLabel, getPeriodDate } from './../helpers/periods';
import { getMeasuresAndVariations } from '../../../api/measures';
let props = _.extend({}, this.props, this.state);
return <div className="overview-domains-list">
- <GeneralIssues {...props} history={this.state.history['sqale_index']}/>
+ <GeneralDebt {...props} history={this.state.history['sqale_index']}/>
<GeneralCoverage {...props} coverageMetricPrefix={this.state.coverageMetricPrefix}
history={this.state.history[coverageMetric]}/>
<GeneralDuplications {...props} history={this.state.history['duplicated_lines_density']}/>
- <GeneralSize {...props} history={this.state.history['ncloc']}/>
+ <GeneralStructure {...props} history={this.state.history['ncloc']}/>
</div>;
}
});
+++ /dev/null
-import React from 'react';
-
-import { Domain,
- DomainHeader,
- DomainPanel,
- DomainNutshell,
- DomainLeak,
- MeasuresList,
- Measure,
- DomainMixin } from './components';
-import { DrilldownLink } from '../../../components/shared/drilldown-link';
-import { TooltipsMixin } from '../../../components/mixins/tooltips-mixin';
-import { getMetricName } from '../helpers/metrics';
-import { formatMeasure, formatMeasureVariation } from '../../../helpers/measures';
-import { LanguageDistribution } from '../components/language-distribution';
-
-
-export const GeneralSize = React.createClass({
- propTypes: {
- leakPeriodLabel: React.PropTypes.string,
- leakPeriodDate: React.PropTypes.object
- },
-
- mixins: [TooltipsMixin, DomainMixin],
-
- renderLeak () {
- if (!this.hasLeakPeriod()) {
- return null;
- }
- let measure = this.props.leak['ncloc'];
- let formatted = measure != null ? formatMeasureVariation(measure, 'SHORT_INT') : '—';
- return <DomainLeak>
- <MeasuresList>
- <Measure label={getMetricName('ncloc')}>{formatted}</Measure>
- </MeasuresList>
- {this.renderTimeline('after')}
- </DomainLeak>;
- },
-
- renderLanguageDistribution() {
- if (!this.props.measures['ncloc'] || !this.props.measures['ncloc_language_distribution']) {
- return null;
- }
- return <Measure composite={true}>
- <div style={{ width: 200 }}>
- <LanguageDistribution lines={this.props.measures['ncloc']}
- distribution={this.props.measures['ncloc_language_distribution']}/>
- </div>
- </Measure>;
- },
-
- render () {
- return <Domain>
- <DomainHeader component={this.props.component} title={window.t('overview.domain.size')} linkTo="/size"/>
-
- <DomainPanel domain="size">
- <DomainNutshell>
- <MeasuresList>
- {this.renderLanguageDistribution()}
- <Measure label={getMetricName('ncloc')}>
- <DrilldownLink component={this.props.component.key} metric="ncloc">
- {formatMeasure(this.props.measures['ncloc'], 'SHORT_INT')}
- </DrilldownLink>
- </Measure>
- </MeasuresList>
- {this.renderTimeline('before')}
- </DomainNutshell>
- {this.renderLeak()}
- </DomainPanel>
- </Domain>;
- }
-});
--- /dev/null
+import React from 'react';
+
+import { Domain,
+ DomainHeader,
+ DomainPanel,
+ DomainNutshell,
+ DomainLeak,
+ MeasuresList,
+ Measure,
+ DomainMixin } from './components';
+import { DrilldownLink } from '../../../components/shared/drilldown-link';
+import { TooltipsMixin } from '../../../components/mixins/tooltips-mixin';
+import { getMetricName } from '../helpers/metrics';
+import { formatMeasure, formatMeasureVariation } from '../../../helpers/measures';
+import { LanguageDistribution } from '../components/language-distribution';
+
+
+export const GeneralStructure = React.createClass({
+ propTypes: {
+ leakPeriodLabel: React.PropTypes.string,
+ leakPeriodDate: React.PropTypes.object
+ },
+
+ mixins: [TooltipsMixin, DomainMixin],
+
+ renderLeak () {
+ if (!this.hasLeakPeriod()) {
+ return null;
+ }
+ let measure = this.props.leak['ncloc'];
+ let formatted = measure != null ? formatMeasureVariation(measure, 'SHORT_INT') : '—';
+ return <DomainLeak>
+ <MeasuresList>
+ <Measure label={getMetricName('ncloc')}>{formatted}</Measure>
+ </MeasuresList>
+ {this.renderTimeline('after')}
+ </DomainLeak>;
+ },
+
+ renderLanguageDistribution() {
+ if (!this.props.measures['ncloc'] || !this.props.measures['ncloc_language_distribution']) {
+ return null;
+ }
+ return <Measure composite={true}>
+ <div style={{ width: 200 }}>
+ <LanguageDistribution lines={this.props.measures['ncloc']}
+ distribution={this.props.measures['ncloc_language_distribution']}/>
+ </div>
+ </Measure>;
+ },
+
+ render () {
+ return <Domain>
+ <DomainHeader component={this.props.component}
+ title={window.t('overview.domain.structure')}
+ linkTo="/structure"/>
+
+ <DomainPanel>
+ <DomainNutshell>
+ <MeasuresList>
+ {this.renderLanguageDistribution()}
+ <Measure label={getMetricName('ncloc')}>
+ <DrilldownLink component={this.props.component.key} metric="ncloc">
+ {formatMeasure(this.props.measures['ncloc'], 'SHORT_INT')}
+ </DrilldownLink>
+ </Measure>
+ </MeasuresList>
+ {this.renderTimeline('before')}
+ </DomainNutshell>
+ {this.renderLeak()}
+ </DomainPanel>
+ </Domain>;
+ }
+});
import Gate from './gate/gate';
import GeneralMain from './main/main';
import Meta from './meta';
-import { SizeMain } from './domains/size-domain';
+import { StructureMain } from './domains/structure-domain';
import { DuplicationsMain } from './domains/duplications-domain';
import { CoverageMain } from './domains/coverage-domain';
-import { IssuesMain } from './domains/debt-domain';
+import { DebtMain } from './domains/debt-domain';
import { getMetrics } from '../../api/metrics';
import { RouterMixin } from '../../components/router/router';
renderSize () {
return <div className="overview">
- <SizeMain {...this.props} {...this.state}/>
+ <StructureMain {...this.props} {...this.state}/>
</div>;
},
renderIssues () {
return <div className="overview">
- <IssuesMain {...this.props} {...this.state}/>
+ <DebtMain {...this.props} {...this.state}/>
</div>;
},
switch (this.state.route) {
case '':
return this.renderMain();
- case '/size':
+ case '/structure':
return this.renderSize();
case '/duplications':
return this.renderDuplications();
- case '/tests':
+ case '/coverage':
return this.renderTests();
- case '/issues':
+ case '/debt':
return this.renderIssues();
default:
throw new Error('Unknown route: ' + this.state.route);
const FIXED_DASHBOARDS = [
{ link: '', name: 'overview.page' },
- { link: '/issues', name: 'overview.domain.debt' },
- { link: '/tests', name: 'overview.domain.coverage' },
+ { link: '/debt', name: 'overview.domain.debt' },
+ { link: '/coverage', name: 'overview.domain.coverage' },
{ link: '/duplications', name: 'overview.domain.duplications' },
- { link: '/size', name: 'overview.domain.size' }
+ { link: '/structure', name: 'overview.domain.structure' }
];
const SETTINGS_URLS = [
overview.domain.debt=Technical Debt
overview.domain.coverage=Coverage
overview.domain.duplications=Duplications
-overview.domain.size=Size
+overview.domain.structure=Structure
overview.chart.files=Files
overview.chart.files.limit_message=Only {0} files are displayed.