Global Metrics
path: .metrics.mi.mi_visual_studio
old: 35.743603994161916
new: 35.72703209662312
path: .metrics.mi.mi_original
old: 61.12156283001687
new: 61.09322488522554
path: .metrics.mi.mi_sei
old: 38.04721262499035
new: 38.00632961257091
path: .metrics.halstead.difficulty
old: 12.884615384615383
new: 13.076923076923077
path: .metrics.halstead.effort
old: 13569.36070462044
new: 13847.14469751333
path: .metrics.halstead.bugs
old: 0.18963493045093976
new: 0.19221424300015608
path: .metrics.halstead.N2
old: 67.0
new: 68.0
path: .metrics.halstead.length
old: 183.0
new: 184.0
path: .metrics.halstead.level
old: 0.07761194029850746
new: 0.07647058823529412
path: .metrics.halstead.time
old: 753.8533724789133
new: 769.2858165285184
path: .metrics.halstead.purity_ratio
old: 1.44663412825003
new: 1.438771986248671
path: .metrics.halstead.volume
old: 1053.144412895915
new: 1058.899300398078
Spaces Data
Minimal test - lines (8, 82)
path: .spaces[0].metrics.mi.mi_original
old: 62.93249169600986
new: 62.903682758056675
path: .spaces[0].metrics.mi.mi_sei
old: 35.47883753867923
new: 35.43727502676087
path: .spaces[0].metrics.mi.mi_visual_studio
old: 36.80262672281279
new: 36.78577939067642
path: .spaces[0].metrics.halstead.effort
old: 13519.286088294077
new: 13803.537744509493
path: .spaces[0].metrics.halstead.difficulty
old: 13.175675675675675
new: 13.37837837837838
path: .spaces[0].metrics.halstead.length
old: 180.0
new: 181.0
path: .spaces[0].metrics.halstead.volume
old: 1026.0791492653966
new: 1031.7795889835377
path: .spaces[0].metrics.halstead.time
old: 751.071449349671
new: 766.863208028305
path: .spaces[0].metrics.halstead.bugs
old: 0.1891681068672389
new: 0.1918104878995786
path: .spaces[0].metrics.halstead.N2
old: 65.0
new: 66.0
path: .spaces[0].metrics.halstead.level
old: 0.0758974358974359
new: 0.07474747474747474
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.3964062970133275
new: 1.388691345096127
Code
define(function(require, exports, module) {
// Dependencies
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const { span } = require("devtools/client/shared/vendor/react-dom-factories");
const {
getGripType,
wrapRender,
} = require("devtools/client/shared/components/reps/reps/rep-utils");
const {
rep: StringRep,
} = require("devtools/client/shared/components/reps/reps/string");
const MAX_STRING_LENGTH = 50;
/**
* Renders a symbol.
*/
SymbolRep.propTypes = {
object: PropTypes.object.isRequired,
shouldRenderTooltip: PropTypes.bool,
};
function SymbolRep(props) {
const {
className = "objectBox objectBox-symbol",
object,
shouldRenderTooltip,
} = props;
const { name } = object;
let symbolText = name || "";
if (name && name !== "Symbol.iterator" && name !== "Symbol.asyncIterator") {
symbolText = StringRep({
object: symbolText,
shouldCrop: true,
cropLimit: MAX_STRING_LENGTH,
useQuotes: true,
});
}
const config = getElementConfig(
{
shouldRenderTooltip,
className,
name,
},
object
);
return span(config, "Symbol(", symbolText, ")");
}
function getElementConfig(opts, object) {
const { shouldRenderTooltip, className, name } = opts;
return {
"data-link-actor-id": object.actor,
className: className,
title: shouldRenderTooltip ? `Symbol(${name})` : null,
};
}
function supportsObject(object, noGrip = false) {
return getGripType(object, noGrip) == "symbol";
}
// Exports from this module
module.exports = {
rep: wrapRender(SymbolRep),
supportsObject,
};
});
Minimal test - lines (73, 75)
path: .spaces[0].spaces[2].metrics.mi.mi_sei
old: 115.19959464458498
new: 114.71542574174929
path: .spaces[0].spaces[2].metrics.mi.mi_visual_studio
old: 77.34007614346245
new: 77.14381865228387
path: .spaces[0].spaces[2].metrics.mi.mi_original
old: 132.2515302053208
new: 131.9159298954054
path: .spaces[0].spaces[2].metrics.halstead.N2
old: 7.0
new: 8.0
path: .spaces[0].spaces[2].metrics.halstead.length
old: 15.0
new: 16.0
path: .spaces[0].spaces[2].metrics.halstead.purity_ratio
old: 2.067970000576925
new: 1.938721875540867
path: .spaces[0].spaces[2].metrics.halstead.volume
old: 53.77443751081734
new: 57.3594000115385
path: .spaces[0].spaces[2].metrics.halstead.level
old: 0.2857142857142857
new: 0.25
path: .spaces[0].spaces[2].metrics.halstead.time
old: 10.456140627103371
new: 12.746533335897444
path: .spaces[0].spaces[2].metrics.halstead.bugs
old: 0.010947325359591292
new: 0.012492666300851833
path: .spaces[0].spaces[2].metrics.halstead.difficulty
old: 3.5
new: 4.0
path: .spaces[0].spaces[2].metrics.halstead.effort
old: 188.2105312878607
new: 229.437600046154
Code
function supportsObject(object, noGrip = false) {
return getGripType(object, noGrip) == "symbol";
}