Global Metrics
path: .metrics.mi.mi_original
old: 59.59067043899064
new: 46.30764898186061
path: .metrics.mi.mi_visual_studio
old: 34.84834528595944
new: 27.08049648062024
path: .metrics.mi.mi_sei
old: 53.88813423513955
new: 34.67949776667975
path: .metrics.nexits.sum
old: 5.0
new: 4.0
path: .metrics.nexits.average
old: 5.0
new: 1.0
path: .metrics.nom.total
old: 1.0
new: 4.0
path: .metrics.nom.functions
old: 1.0
new: 4.0
path: .metrics.loc.blank
old: 0.0
new: 48.0
path: .metrics.loc.sloc
old: 73.0
new: 182.0
path: .metrics.loc.cloc
old: 30.0
new: 78.0
path: .metrics.loc.lloc
old: 36.0
new: 5.0
path: .metrics.loc.ploc
old: 46.0
new: 56.0
path: .metrics.nargs.average
old: 1.0
new: 0.75
path: .metrics.nargs.sum
old: 1.0
new: 3.0
path: .metrics.halstead.N2
old: 103.0
new: 88.0
path: .metrics.halstead.n2
old: 27.0
new: 49.0
path: .metrics.halstead.estimated_program_length
old: 232.42388754772497
new: 339.1207823616452
path: .metrics.halstead.length
old: 264.0
new: 241.0
path: .metrics.halstead.level
old: 0.022794428028704093
new: 0.06960227272727272
path: .metrics.halstead.N1
old: 161.0
new: 153.0
path: .metrics.halstead.time
old: 3631.4382333170265
new: 1158.479606156077
path: .metrics.halstead.difficulty
old: 43.870370370370374
new: 14.36734693877551
path: .metrics.halstead.effort
old: 65365.888199706475
new: 20852.63291080938
path: .metrics.halstead.volume
old: 1489.978034100527
new: 1451.3906429398576
path: .metrics.halstead.n1
old: 23.0
new: 16.0
path: .metrics.halstead.purity_ratio
old: 0.880393513438352
new: 1.4071401757744613
path: .metrics.halstead.vocabulary
old: 50.0
new: 65.0
path: .metrics.halstead.bugs
old: 0.5408948625175058
new: 0.25253370121449004
path: .metrics.cognitive.sum
old: 44.0
new: 4.0
path: .metrics.cognitive.average
old: 44.0
new: 1.0
path: .metrics.cyclomatic.sum
old: 17.0
new: 11.0
path: .metrics.cyclomatic.average
old: 8.5
new: 1.5714285714285714
Spaces Data
Minimal test - lines (20, 94)
path: .spaces[0].metrics.nargs.sum
old: 1.0
new: 2.0
path: .spaces[0].metrics.nom.functions
old: 1.0
new: 2.0
path: .spaces[0].metrics.nom.total
old: 1.0
new: 2.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 0.853249340053021
new: 1.00983508354153
path: .spaces[0].metrics.halstead.bugs
old: 0.5459387797263592
new: 0.18395305619081004
path: .spaces[0].metrics.halstead.length
old: 258.0
new: 167.0
path: .spaces[0].metrics.halstead.level
old: 0.021739130434782608
new: 0.06808510638297872
path: .spaces[0].metrics.halstead.n2
old: 25.0
new: 24.0
path: .spaces[0].metrics.halstead.N1
old: 158.0
new: 120.0
path: .spaces[0].metrics.halstead.time
old: 3682.3519421421497
new: 720.2278127751699
path: .spaces[0].metrics.halstead.vocabulary
old: 48.0
new: 39.0
path: .spaces[0].metrics.halstead.volume
old: 1440.9203251860583
new: 882.6621705499955
path: .spaces[0].metrics.halstead.N2
old: 100.0
new: 47.0
path: .spaces[0].metrics.halstead.difficulty
old: 46.0
new: 14.6875
path: .spaces[0].metrics.halstead.estimated_program_length
old: 220.13832973367943
new: 168.64245895143551
path: .spaces[0].metrics.halstead.n1
old: 23.0
new: 15.0
path: .spaces[0].metrics.halstead.effort
old: 66282.33495855868
new: 12964.100629953058
path: .spaces[0].metrics.cognitive.sum
old: 44.0
new: 4.0
path: .spaces[0].metrics.cognitive.average
old: 44.0
new: 2.0
path: .spaces[0].metrics.cyclomatic.sum
old: 16.0
new: 7.0
path: .spaces[0].metrics.cyclomatic.average
old: 16.0
new: 2.3333333333333335
path: .spaces[0].metrics.loc.sloc
old: 43.0
new: 75.0
path: .spaces[0].metrics.loc.ploc
old: 43.0
new: 24.0
path: .spaces[0].metrics.loc.blank
old: 0.0
new: 11.0
path: .spaces[0].metrics.loc.lloc
old: 36.0
new: 3.0
path: .spaces[0].metrics.loc.cloc
old: 9.0
new: 40.0
path: .spaces[0].metrics.nexits.average
old: 5.0
new: 1.5
path: .spaces[0].metrics.nexits.sum
old: 5.0
new: 3.0
path: .spaces[0].metrics.mi.mi_original
old: 68.56876414945836
new: 64.17539138085391
path: .spaces[0].metrics.mi.mi_visual_studio
old: 40.09869248506337
new: 37.529468643774216
path: .spaces[0].metrics.mi.mi_sei
old: 57.396320967959014
new: 62.847217213642125
Code
struct nsID {
/**
* @name Identifier values
*/
//@{
uint32_t m0;
uint16_t m1;
uint16_t m2;
uint8_t m3[8];
//@}
/**
* @name Methods
*/
//@{
/**
* Ensures everything is zeroed out.
*/
void Clear();
/**
* Equivalency method. Compares this nsID with another.
* @return true if they are the same, false if not.
*/
inline bool Equals(const nsID& aOther) const {
// At the time of this writing, modern compilers (namely Clang) inline this
// memcmp call into a single SIMD operation on x86/x86-64 architectures (as
// long as we compare to zero rather than returning the full integer return
// value), which is measurably more efficient to any manual comparisons we
// can do directly.
#if defined(__x86_64__) || defined(__i386__)
return !memcmp(this, &aOther, sizeof *this);
#else
// However, on ARM architectures, compilers still tend to generate a direct
// memcmp call, which we'd like to avoid.
return (((uint32_t*)&m0)[0] == ((uint32_t*)&aOther.m0)[0]) &&
(((uint32_t*)&m0)[1] == ((uint32_t*)&aOther.m0)[1]) &&
(((uint32_t*)&m0)[2] == ((uint32_t*)&aOther.m0)[2]) &&
(((uint32_t*)&m0)[3] == ((uint32_t*)&aOther.m0)[3]);
#endif
}
inline bool operator==(const nsID& aOther) const { return Equals(aOther); }
/**
* nsID Parsing method. Turns a {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
* string into an nsID
*/
bool Parse(const char* aIDStr);
#ifndef XPCOM_GLUE_AVOID_NSPR
/**
* nsID string encoder. Returns an allocated string in
* {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} format. Caller should free string.
* YOU SHOULD ONLY USE THIS IF YOU CANNOT USE ToProvidedString() BELOW.
*/
char* ToString() const;
/**
* nsID string encoder. Builds a string in
* {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} format, into a char[NSID_LENGTH]
* buffer provided by the caller (for instance, on the stack).
*/
void ToProvidedString(char (&aDest)[NSID_LENGTH]) const;
#endif // XPCOM_GLUE_AVOID_NSPR
// Infallibly duplicate an nsID. Must be freed with free().
nsID* Clone() const;
//@}
};