Global Metrics
path: .metrics.cognitive.sum
old: 7.0
new: 0.0
path: .metrics.cognitive.average
old: 0.7777777777777778
new: 0.0
path: .metrics.halstead.time
old: 8125.608625804592
new: 619.0426347378798
path: .metrics.halstead.vocabulary
old: 158.0
new: 73.0
path: .metrics.halstead.effort
old: 146260.95526448265
new: 11142.767425281836
path: .metrics.halstead.difficulty
old: 28.00751879699248
new: 9.425
path: .metrics.halstead.volume
old: 5222.203234946629
new: 1182.2564907460833
path: .metrics.halstead.N1
old: 417.0
new: 104.0
path: .metrics.halstead.N2
old: 298.0
new: 87.0
path: .metrics.halstead.bugs
old: 0.9253322153092284
new: 0.16629305908288375
path: .metrics.halstead.estimated_program_length
old: 1054.4489686660263
new: 402.5191520723453
path: .metrics.halstead.purity_ratio
old: 1.4747538023301068
new: 2.107430115562017
path: .metrics.halstead.length
old: 715.0
new: 191.0
path: .metrics.halstead.n2
old: 133.0
new: 60.0
path: .metrics.halstead.level
old: 0.03570469798657718
new: 0.10610079575596816
path: .metrics.halstead.n1
old: 25.0
new: 13.0
path: .metrics.nexits.sum
old: 4.0
new: 0.0
path: .metrics.nexits.average
old: 0.4444444444444444
new: 0.0
path: .metrics.nom.functions
old: 9.0
new: 2.0
path: .metrics.nom.total
old: 9.0
new: 2.0
path: .metrics.cyclomatic.sum
old: 27.0
new: 4.0
path: .metrics.cyclomatic.average
old: 2.4545454545454546
new: 1.0
path: .metrics.loc.cloc
old: 10.0
new: 25.0
path: .metrics.loc.ploc
old: 109.0
new: 60.0
path: .metrics.loc.blank
old: 13.0
new: 20.0
path: .metrics.loc.sloc
old: 132.0
new: 105.0
path: .metrics.loc.lloc
old: 77.0
new: 0.0
path: .metrics.mi.mi_original
old: 41.17310058316278
new: 57.89490543475034
path: .metrics.mi.mi_sei
old: 7.128369036523772
new: 42.52936530049615
path: .metrics.mi.mi_visual_studio
old: 24.07783659834081
new: 33.85666984488324
path: .metrics.nargs.sum
old: 6.0
new: 0.0
path: .metrics.nargs.average
old: 0.6666666666666666
new: 0.0
Spaces Data
Minimal test - lines (60, 60)
path: .spaces[0].spaces[1].metrics.mi.mi_original
old: 98.54504994353468
new: 159.95690398326485
path: .spaces[0].spaces[1].metrics.mi.mi_sei
old: 66.77506244389335
new: 155.17000000000002
path: .spaces[0].spaces[1].metrics.mi.mi_visual_studio
old: 57.62868417750566
new: 93.54204911302038
path: .spaces[0].spaces[1].metrics.cyclomatic.average
old: 3.0
new: 1.0
path: .spaces[0].spaces[1].metrics.cyclomatic.sum
old: 3.0
new: 1.0
path: .spaces[0].spaces[1].metrics.nexits.average
old: 1.0
new: 0.0
path: .spaces[0].spaces[1].metrics.nexits.sum
old: 1.0
new: 0.0
path: .spaces[0].spaces[1].metrics.loc.lloc
old: 8.0
new: 0.0
path: .spaces[0].spaces[1].metrics.loc.sloc
old: 13.0
new: 1.0
path: .spaces[0].spaces[1].metrics.loc.ploc
old: 12.0
new: 1.0
path: .spaces[0].spaces[1].metrics.loc.blank
old: 1.0
new: 0.0
path: .spaces[0].spaces[1].metrics.halstead.estimated_program_length
old: 118.76437056043838
new: 4.754887502163468
path: .spaces[0].spaces[1].metrics.halstead.time
old: 155.61443099406432
new: 0.6666666666666666
path: .spaces[0].spaces[1].metrics.halstead.vocabulary
old: 30.0
new: 4.0
path: .spaces[0].spaces[1].metrics.halstead.n2
old: 19.0
new: 1.0
path: .spaces[0].spaces[1].metrics.halstead.effort
old: 2801.059757893158
new: 12.0
path: .spaces[0].spaces[1].metrics.halstead.difficulty
old: 8.394736842105264
new: 1.5
path: .spaces[0].spaces[1].metrics.halstead.n1
old: 11.0
new: 3.0
path: .spaces[0].spaces[1].metrics.halstead.N1
old: 39.0
new: 3.0
path: .spaces[0].spaces[1].metrics.halstead.N2
old: 29.0
new: 1.0
path: .spaces[0].spaces[1].metrics.halstead.purity_ratio
old: 1.7465348611829177
new: 1.188721875540867
path: .spaces[0].spaces[1].metrics.halstead.length
old: 68.0
new: 4.0
path: .spaces[0].spaces[1].metrics.halstead.bugs
old: 0.06623593349225605
new: 0.0017471609294725976
path: .spaces[0].spaces[1].metrics.halstead.level
old: 0.11912225705329152
new: 0.6666666666666666
path: .spaces[0].spaces[1].metrics.halstead.volume
old: 333.66856050137926
new: 8.0
Code
~nsMacUtilsImpl() {}
Minimal test - lines (26, 26)
path: .spaces[0].spaces[0].metrics.halstead.level
old: 0.16666666666666666
new: 1.0
path: .spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 1.723308333814104
new: 0.6666666666666666
path: .spaces[0].spaces[0].metrics.halstead.effort
old: 151.59716579111063
new: 4.754887502163468
path: .spaces[0].spaces[0].metrics.halstead.N1
old: 7.0
new: 2.0
path: .spaces[0].spaces[0].metrics.halstead.volume
old: 25.26619429851844
new: 4.754887502163468
path: .spaces[0].spaces[0].metrics.halstead.difficulty
old: 6.0
new: 1.0
path: .spaces[0].spaces[0].metrics.halstead.n1
old: 6.0
new: 2.0
path: .spaces[0].spaces[0].metrics.halstead.time
old: 8.422064766172813
new: 0.26416041678685936
path: .spaces[0].spaces[0].metrics.halstead.length
old: 9.0
new: 3.0
path: .spaces[0].spaces[0].metrics.halstead.N2
old: 2.0
new: 1.0
path: .spaces[0].spaces[0].metrics.halstead.vocabulary
old: 7.0
new: 3.0
path: .spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 15.509775004326936
new: 2.0
path: .spaces[0].spaces[0].metrics.halstead.bugs
old: 0.009477041882051136
new: 0.0009425525573729414
path: .spaces[0].spaces[0].metrics.nargs.average
old: 1.0
new: 0.0
path: .spaces[0].spaces[0].metrics.nargs.sum
old: 1.0
new: 0.0
path: .spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 90.04489473439764
new: 95.12415216859318
path: .spaces[0].spaces[0].metrics.mi.mi_sei
old: 146.54249035246173
new: 159.07306171748976
path: .spaces[0].spaces[0].metrics.mi.mi_original
old: 153.97676999581998
new: 162.66230020829434
Code
nsMacUtilsImpl() {}
Minimal test - lines (21, 93)
path: .spaces[0].metrics.cyclomatic.average
old: 2.6
new: 1.0
path: .spaces[0].metrics.cyclomatic.sum
old: 26.0
new: 3.0
path: .spaces[0].metrics.nom.total
old: 9.0
new: 2.0
path: .spaces[0].metrics.nom.functions
old: 9.0
new: 2.0
path: .spaces[0].metrics.halstead.time
old: 8138.061272982221
new: 537.5882352941176
path: .spaces[0].metrics.halstead.volume
old: 5208.359214708622
new: 1026.0
path: .spaces[0].metrics.halstead.length
old: 714.0
new: 171.0
path: .spaces[0].metrics.halstead.n1
old: 25.0
new: 13.0
path: .spaces[0].metrics.halstead.N1
old: 417.0
new: 97.0
path: .spaces[0].metrics.halstead.level
old: 0.035555555555555556
new: 0.10602910602910602
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.4649249698875126
new: 1.9730959577566107
path: .spaces[0].metrics.halstead.effort
old: 146485.10291368
new: 9676.588235294115
path: .spaces[0].metrics.halstead.n2
old: 132.0
new: 51.0
path: .spaces[0].metrics.halstead.vocabulary
old: 157.0
new: 64.0
path: .spaces[0].metrics.halstead.estimated_program_length
old: 1045.956428499684
new: 337.3994087763804
path: .spaces[0].metrics.halstead.N2
old: 297.0
new: 74.0
path: .spaces[0].metrics.halstead.bugs
old: 0.9262773666180946
new: 0.15136550679438876
path: .spaces[0].metrics.halstead.difficulty
old: 28.125
new: 9.431372549019608
path: .spaces[0].metrics.nexits.average
old: 0.4444444444444444
new: 0.0
path: .spaces[0].metrics.nexits.sum
old: 4.0
new: 0.0
path: .spaces[0].metrics.loc.cloc
old: 0.0
new: 17.0
path: .spaces[0].metrics.loc.ploc
old: 108.0
new: 45.0
path: .spaces[0].metrics.loc.lloc
old: 77.0
new: 0.0
path: .spaces[0].metrics.loc.sloc
old: 120.0
new: 73.0
path: .spaces[0].metrics.loc.blank
old: 12.0
new: 11.0
path: .spaces[0].metrics.cognitive.sum
old: 7.0
new: 0.0
path: .spaces[0].metrics.cognitive.average
old: 0.7777777777777778
new: 0.0
path: .spaces[0].metrics.mi.mi_visual_studio
old: 25.123350269099543
new: 37.86593995298031
path: .spaces[0].metrics.mi.mi_sei
old: -11.07401648469056
new: 52.01420085788949
path: .spaces[0].metrics.mi.mi_original
old: 42.96092896016022
new: 64.75075731959633
path: .spaces[0].metrics.nargs.average
old: 0.6666666666666666
new: 0.0
path: .spaces[0].metrics.nargs.sum
old: 6.0
new: 0.0
Code
class nsMacUtilsImpl final : public nsIMacUtils {
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIMACUTILS
nsMacUtilsImpl() {}
// Return the repo directory and the repo object directory respectively.
// These should only be used on Mac developer builds to determine the path
// to the repo or object directory.
static nsresult GetRepoDir(nsIFile** aRepoDir);
static nsresult GetObjDir(nsIFile** aObjDir);
#if defined(MOZ_SANDBOX)
static bool GetAppPath(nsCString& aAppPath);
# ifdef DEBUG
static nsresult GetBloatLogDir(nsCString& aDirectoryPath);
static nsresult GetDirectoryPath(const char* aPath,
nsCString& aDirectoryPath);
# endif /* DEBUG */
#endif /* MOZ_SANDBOX */
static void EnableTCSMIfAvailable();
static bool IsTCSMAvailable();
static uint32_t GetPhysicalCPUCount();
static nsresult GetArchitecturesForBundle(uint32_t* aArchMask);
static nsresult GetArchitecturesForBinary(const char* aPath,
uint32_t* aArchMask);
#if defined(__aarch64__)
// Pre-translate binaries to avoid translation delays when launching
// x64 child process instances for the first time. i.e. on first launch
// after installation or after an update. Translations are cached so
// repeated launches of the binaries do not encounter delays.
static int PreTranslateXUL();
static int PreTranslateBinary(nsCString aBinaryPath);
#endif
private:
~nsMacUtilsImpl() {}
nsresult GetArchString(nsAString& aArchString);
// A string containing a "-" delimited list of architectures
// in our binary.
nsString mBinaryArchs;
#if defined(MOZ_SANDBOX)
// Cache the appDir returned from GetAppPath to avoid doing I/O
static StaticAutoPtr sCachedAppPath;
// For thread safe setting/checking of sCachedAppPath
static StaticMutex sCachedAppPathMutex;
// Utility method to call ClearOnShutdown() on the main thread
static nsresult ClearCachedAppPathOnShutdown();
#endif
// The cached machine architectures of the .app bundle which can
// be multiple architectures for universal binaries.
static std::atomic sBundleArchMaskAtomic;
#if defined(__aarch64__)
// Limit XUL translation to one attempt
static std::atomic sIsXULTranslated;
#endif
enum TCSMStatus { TCSM_Unknown = 0, TCSM_Available, TCSM_Unavailable };
static mozilla::Atomic sTCSMStatus;
static nsresult EnableTCSM();
#if defined(DEBUG)
static bool IsTCSMEnabled();
#endif
};