Global Metrics
path: .metrics.halstead.effort
old: 45714.36487091521
new: 46628.70259136957
path: .metrics.halstead.N2
old: 133.0
new: 135.0
path: .metrics.halstead.length
old: 409.0
new: 411.0
path: .metrics.halstead.purity_ratio
old: 1.2140509475394996
new: 1.208143157040524
path: .metrics.halstead.level
old: 0.05764411027568922
new: 0.05679012345679012
path: .metrics.halstead.bugs
old: 0.4261677079844556
new: 0.4318314810421235
path: .metrics.halstead.difficulty
old: 17.347826086956523
new: 17.608695652173914
path: .metrics.halstead.time
old: 2539.686937273067
new: 2590.4834772983095
path: .metrics.halstead.volume
old: 2635.1638898021297
new: 2648.0497767938273
path: .metrics.mi.mi_visual_studio
old: 27.01606174782115
new: 27.001227885857503
path: .metrics.mi.mi_original
old: 46.197465588774165
new: 46.17209968481633
path: .metrics.mi.mi_sei
old: 18.73243847708705
new: 18.695843213239392
Spaces Data
Minimal test - lines (67, 81)
path: .spaces[0].spaces[3].metrics.mi.mi_sei
old: 66.99089617050629
new: 66.83620998485725
path: .spaces[0].spaces[3].metrics.mi.mi_original
old: 98.7652306310774
new: 98.65801033762318
path: .spaces[0].spaces[3].metrics.mi.mi_visual_studio
old: 57.75744481349555
new: 57.69474288749894
path: .spaces[0].spaces[3].metrics.halstead.level
old: 0.18055555555555555
new: 0.1699346405228758
path: .spaces[0].spaces[3].metrics.halstead.time
old: 65.86237467525854
new: 71.43666419855518
path: .spaces[0].spaces[3].metrics.halstead.volume
old: 214.05271769459029
new: 218.5121493132276
path: .spaces[0].spaces[3].metrics.halstead.purity_ratio
old: 1.596563361433646
new: 1.563980435690102
path: .spaces[0].spaces[3].metrics.halstead.bugs
old: 0.03733808202871282
new: 0.039416179442020055
path: .spaces[0].spaces[3].metrics.halstead.N2
old: 16.0
new: 17.0
path: .spaces[0].spaces[3].metrics.halstead.length
old: 48.0
new: 49.0
path: .spaces[0].spaces[3].metrics.halstead.difficulty
old: 5.538461538461538
new: 5.884615384615385
path: .spaces[0].spaces[3].metrics.halstead.effort
old: 1185.5227441546538
new: 1285.8599555739931
Code
renderStackTrace(stacktrace = "") {
const re = /:\d+:\d+/g;
const traces = stacktrace
.replace(re, "$&,")
.split(",")
.map((trace, index) => {
return p({}, trace);
});
return div(
{ className: "stack-trace-section" },
h3({}, "Stacktrace"),
traces
);
}
Minimal test - lines (26, 135)
path: .spaces[0].metrics.halstead.effort
old: 37291.31571966792
new: 38201.44417011582
path: .spaces[0].metrics.halstead.N2
old: 108.0
new: 110.0
path: .spaces[0].metrics.halstead.length
old: 346.0
new: 348.0
path: .spaces[0].metrics.halstead.level
old: 0.05761316872427984
new: 0.05656565656565657
path: .spaces[0].metrics.halstead.time
old: 2071.739762203774
new: 2122.302453895323
path: .spaces[0].metrics.halstead.bugs
old: 0.3720636277536423
new: 0.37809296741371506
path: .spaces[0].metrics.halstead.difficulty
old: 17.357142857142858
new: 17.678571428571427
path: .spaces[0].metrics.halstead.volume
old: 2148.4708645076166
new: 2160.889771238875
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.156851230234646
new: 1.150202659945941
path: .spaces[0].metrics.mi.mi_visual_studio
old: 29.8509693183378
new: 29.83344226305878
path: .spaces[0].metrics.mi.mi_original
old: 51.04515753435764
new: 51.01518626983052
path: .spaces[0].metrics.mi.mi_sei
old: 19.95959218001994
new: 19.91635278531751
Code
class AppErrorBoundary extends Component {
static get propTypes() {
return {
children: PropTypes.any.isRequired,
};
}
constructor(props) {
super(props);
this.state = {
errorMsg: "No error",
errorStack: null,
errorInfo: null,
};
}
/**
* Map the `info` object to a render.
* Currently, `info` usually just contains something similar to the
* following object (which is provided to componentDidCatch):
* componentStack: {"\n in (component) \n in (other component)..."}
*/
renderErrorInfo(info = {}) {
if (Object.keys(info).length > 0) {
return Object.keys(info).map((obj, outerIdx) => {
const traceParts = info[obj]
.split("\n")
.map((part, idx) => p({ key: `strace${idx}` }, part));
return div(
{ key: `st-div-${outerIdx}`, className: "stack-trace-section" },
h3({}, "React Component Stack"),
p({ key: `st-p-${outerIdx}` }, obj.toString()),
traceParts
);
});
}
return p({}, "undefined errorInfo");
}
renderStackTrace(stacktrace = "") {
const re = /:\d+:\d+/g;
const traces = stacktrace
.replace(re, "$&,")
.split(",")
.map((trace, index) => {
return p({}, trace);
});
return div(
{ className: "stack-trace-section" },
h3({}, "Stacktrace"),
traces
);
}
// Return a valid object, even if we don't receive one
getValidInfo(infoObj) {
if (!infoObj.componentStack) {
try {
return { componentStack: JSON.stringify(infoObj) };
} catch (err) {
return { componentStack: `Unknown Error: ${err}` };
}
}
return infoObj;
}
// Called when a child component throws an error.
componentDidCatch(error, info) {
const validInfo = this.getValidInfo(info);
this.setState({
errorMsg: error.toString(),
errorStack: error.stack,
errorInfo: validInfo,
});
}
getBugLink() {
const compStack = this.getValidInfo(this.state.errorInfo).componentStack;
const errorMsg = this.state.errorMsg;
const msg = (errorMsg + compStack).replace(/\n/gi, "%0A");
return `${bugLink}&comment=${msg}`;
}
render() {
if (this.state.errorInfo !== null) {
return div(
{ className: "app-error-panel" },
h1({ className: "error-panel-header" }, ERROR_DESCRIPTION),
a(
{
className: "error-panel-file-button",
href: this.getBugLink(),
onClick: () => {
window.open(this.getBugLink(), "_blank");
},
},
FILE_BUG_BUTTON
),
h2({ className: "error-panel-error" }, this.state.errorMsg),
div({}, this.renderErrorInfo(this.state.errorInfo)),
div({}, this.renderStackTrace(this.state.errorStack)),
p({ className: "error-panel-reload-info" }, RELOAD_PAGE_INFO)
);
}
return this.props.children;
}
}
Minimal test - lines (49, 65)
path: .spaces[0].spaces[2].metrics.mi.mi_visual_studio
old: 54.55146006009286
new: 54.51414749782536
path: .spaces[0].spaces[2].metrics.mi.mi_original
old: 93.2829967027588
new: 93.21919222128136
path: .spaces[0].spaces[2].metrics.mi.mi_sei
old: 59.285344187936744
new: 59.19329377892275
path: .spaces[0].spaces[2].metrics.halstead.difficulty
old: 9.9
new: 10.266666666666667
path: .spaces[0].spaces[2].metrics.halstead.bugs
old: 0.08073302259271006
new: 0.08339370703564768
path: .spaces[0].spaces[2].metrics.halstead.length
old: 81.0
new: 82.0
path: .spaces[0].spaces[2].metrics.halstead.volume
old: 380.7356171694285
new: 385.4360568875695
path: .spaces[0].spaces[2].metrics.halstead.N2
old: 27.0
new: 28.0
path: .spaces[0].spaces[2].metrics.halstead.level
old: 0.101010101010101
new: 0.0974025974025974
path: .spaces[0].spaces[2].metrics.halstead.purity_ratio
old: 1.1932976140634326
new: 1.1787452041358295
path: .spaces[0].spaces[2].metrics.halstead.effort
old: 3769.282609977342
new: 3957.1435173790474
path: .spaces[0].spaces[2].metrics.halstead.time
old: 209.40458944318567
new: 219.8413065210582
Code
renderErrorInfo(info = {}) {
if (Object.keys(info).length > 0) {
return Object.keys(info).map((obj, outerIdx) => {
const traceParts = info[obj]
.split("\n")
.map((part, idx) => p({ key: `strace${idx}` }, part));
return div(
{ key: `st-div-${outerIdx}`, className: "stack-trace-section" },
h3({}, "React Component Stack"),
p({ key: `st-p-${outerIdx}` }, obj.toString()),
traceParts
);
});
}
return p({}, "undefined errorInfo");
}