Global Metrics

path: .metrics.mi.mi_visual_studio
old: 40.50809160152152
new: 41.58690131115953

path: .metrics.mi.mi_sei
old: 71.58401329089166
new: 74.4924128112506

path: .metrics.mi.mi_original
old: 69.2688366386018
new: 71.1136012420828

path: .metrics.halstead.estimated_program_length
old: 112.50641830990963
new: 67.75720079023742

path: .metrics.halstead.length
old: 93.0
new: 52.0

path: .metrics.halstead.vocabulary
old: 29.0
new: 20.0

path: .metrics.halstead.time
old: 622.260135105056
new: 63.868492957779914

path: .metrics.halstead.N2
old: 35.0
new: 19.0

path: .metrics.halstead.bugs
old: 0.1668687712411928
new: 0.03658065923319219

path: .metrics.halstead.N1
old: 58.0
new: 33.0

path: .metrics.halstead.n2
old: 12.0
new: 13.0

path: .metrics.halstead.purity_ratio
old: 1.2097464334398886
new: 1.3030230921199504

path: .metrics.halstead.n1
old: 17.0
new: 7.0

path: .metrics.halstead.volume
old: 451.79223254686417
new: 224.74026093414287

path: .metrics.halstead.level
old: 0.04033613445378151
new: 0.1954887218045113

path: .metrics.halstead.difficulty
old: 24.791666666666668
new: 5.115384615384615

path: .metrics.halstead.effort
old: 11200.682431891008
new: 1149.6328732400384

path: .metrics.loc.sloc
old: 66.0
new: 78.0

path: .metrics.loc.lloc
old: 13.0
new: 2.0

path: .metrics.loc.ploc
old: 17.0
new: 21.0

path: .metrics.loc.blank
old: 10.0
new: 8.0

path: .metrics.loc.cloc
old: 39.0
new: 49.0

path: .metrics.nargs.average
old: 1.0
new: 0.0

path: .metrics.nargs.sum
old: 2.0
new: 0.0

path: .metrics.nexits.average
old: 2.5
new: 0.0

path: .metrics.nexits.sum
old: 5.0
new: 0.0

path: .metrics.cyclomatic.average
old: 3.0
new: 1.0

path: .metrics.cyclomatic.sum
old: 9.0
new: 5.0

path: .metrics.cognitive.average
old: 4.0
new: 0.0

path: .metrics.cognitive.sum
old: 8.0
new: 0.0

Spaces Data

Minimal test - lines (15, 76)

path: .spaces[0].metrics.halstead.bugs
old: 0.04368379846041095
new: 0.03450382900492541

path: .spaces[0].metrics.halstead.N2
old: 12.0
new: 17.0

path: .spaces[0].metrics.halstead.difficulty
old: 12.0
new: 4.958333333333333

path: .spaces[0].metrics.halstead.purity_ratio
old: 1.400903794478451
new: 1.253420689261142

path: .spaces[0].metrics.halstead.vocabulary
old: 15.0
new: 19.0

path: .spaces[0].metrics.halstead.N1
old: 20.0
new: 33.0

path: .spaces[0].metrics.halstead.effort
old: 1500.245988713671
new: 1053.1320293745555

path: .spaces[0].metrics.halstead.n1
old: 10.0
new: 7.0

path: .spaces[0].metrics.halstead.estimated_program_length
old: 44.82892142331043
new: 62.6710344630571

path: .spaces[0].metrics.halstead.level
old: 0.08333333333333333
new: 0.20168067226890757

path: .spaces[0].metrics.halstead.n2
old: 5.0
new: 12.0

path: .spaces[0].metrics.halstead.time
old: 83.34699937298173
new: 58.50733496525308

path: .spaces[0].metrics.halstead.volume
old: 125.0204990594726
new: 212.3963756721793

path: .spaces[0].metrics.halstead.length
old: 32.0
new: 50.0

path: .spaces[0].metrics.loc.lloc
old: 3.0
new: 2.0

path: .spaces[0].metrics.loc.cloc
old: 0.0
new: 38.0

path: .spaces[0].metrics.loc.ploc
old: 7.0
new: 18.0

path: .spaces[0].metrics.loc.sloc
old: 8.0
new: 62.0

path: .spaces[0].metrics.loc.blank
old: 1.0
new: 6.0

path: .spaces[0].metrics.nargs.sum
old: 1.0
new: 0.0

path: .spaces[0].metrics.nargs.average
old: 1.0
new: 0.0

path: .spaces[0].metrics.nexits.average
old: 1.0
new: 0.0

path: .spaces[0].metrics.nexits.sum
old: 1.0
new: 0.0

path: .spaces[0].metrics.cyclomatic.average
old: 2.0
new: 1.0

path: .spaces[0].metrics.cyclomatic.sum
old: 2.0
new: 4.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.mi.mi_original
old: 111.74496289985618
new: 75.35646098950367

path: .spaces[0].metrics.mi.mi_sei
old: 85.71669154673987
new: 80.25346534306198

path: .spaces[0].metrics.mi.mi_visual_studio
old: 65.34793152038374
new: 44.06810584181501

path: .spaces[0].metrics.cognitive.sum
old: 1.0
new: 0.0

path: .spaces[0].metrics.cognitive.average
old: 1.0
new: 0.0

Code

namespace mozilla {

/** Different shutdown check modes */
enum ShutdownChecksMode {
  SCM_CRASH,  /** Crash on shutdown check failure */
  SCM_RECORD, /** Record shutdown check violations */
  SCM_NOTHING /** Don't attempt any shutdown checks */
};

/**
 * Current shutdown check mode.
 * This variable is defined and initialized in nsAppRunner.cpp
 */
extern ShutdownChecksMode gShutdownChecks;

/**
 * Allocate structures and acquire information from XPCOM necessary to do late
 * write checks. This function must be invoked before BeginLateWriteChecks()
 * and before XPCOM has stopped working.
 */
void InitLateWriteChecks();

/**
 * Begin recording all writes as late-writes. This function should be called
 * when all legitimate writes have occurred. This function does not rely on
 * XPCOM as it is designed to be invoked during XPCOM shutdown.
 *
 * For late-write checks to work you must initialize one or more backends that
 * reports IO through the IOInterposer API. PoisonIOInterposer would probably
 * be the backend of choice in this case.
 *
 * Note: BeginLateWriteChecks() must have been invoked before this function.
 */
void BeginLateWriteChecks();

/**
 * Stop recording all writes as late-writes, call this function when you want
 * late-write checks to stop. I.e. exception handling, or the special case on
 * Mac described in bug 826029.
 */
void StopLateWriteChecks();

/**
 * Temporarily suspend late write checks for the current thread. This is useful
 * if you're about to perform a write, but it would be fine if this write were
 * interrupted or skipped during a fast shutdown.
 */
void PushSuspendLateWriteChecks();

/**
 * Resume late write checks for the current thread, assuming an ancestor in the
 * call stack hasn't also pushed a suspension.
 */
void PopSuspendLateWriteChecks();

class MOZ_RAII AutoSuspendLateWriteChecks {
 public:
  AutoSuspendLateWriteChecks() { PushSuspendLateWriteChecks(); }
  ~AutoSuspendLateWriteChecks() { PopSuspendLateWriteChecks(); }
};

}  // namespace mozilla