Global Metrics
path: .metrics.cyclomatic.sum
old: 42.0
new: 13.0
path: .metrics.cyclomatic.average
old: 3.5
new: 1.0
path: .metrics.loc.sloc
old: 244.0
new: 109.0
path: .metrics.loc.blank
old: 39.0
new: 22.0
path: .metrics.loc.lloc
old: 74.0
new: 4.0
path: .metrics.loc.ploc
old: 159.0
new: 76.0
path: .metrics.loc.cloc
old: 46.0
new: 11.0
path: .metrics.cognitive.average
old: 2.727272727272727
new: 0.0
path: .metrics.cognitive.sum
old: 30.0
new: 0.0
path: .metrics.halstead.N1
old: 477.0
new: 181.0
path: .metrics.halstead.difficulty
old: 40.56521739130435
new: 15.034090909090908
path: .metrics.halstead.purity_ratio
old: 1.185835118942714
new: 1.961855586786719
path: .metrics.halstead.vocabulary
old: 145.0
new: 106.0
path: .metrics.halstead.N2
old: 311.0
new: 147.0
path: .metrics.halstead.effort
old: 229508.6035919713
new: 33176.5990197156
path: .metrics.halstead.time
old: 12750.47797733174
new: 1843.1443899842
path: .metrics.halstead.n2
old: 115.0
new: 88.0
path: .metrics.halstead.n1
old: 30.0
new: 18.0
path: .metrics.halstead.estimated_program_length
old: 934.4380737268586
new: 643.4886324660438
path: .metrics.halstead.length
old: 788.0
new: 328.0
path: .metrics.halstead.level
old: 0.02465166130760986
new: 0.06651549508692366
path: .metrics.halstead.bugs
old: 1.2495243553110726
new: 0.3441649619733148
path: .metrics.halstead.volume
old: 5657.768362931768
new: 2206.7579090967292
path: .metrics.nom.total
old: 11.0
new: 7.0
path: .metrics.nom.functions
old: 11.0
new: 7.0
path: .metrics.nargs.average
old: 1.7272727272727273
new: 0.14285714285714285
path: .metrics.nargs.sum
old: 19.0
new: 1.0
path: .metrics.nexits.average
old: 1.0
new: 0.42857142857142855
path: .metrics.nexits.sum
old: 11.0
new: 3.0
path: .metrics.mi.mi_visual_studio
old: 15.996370603271275
new: 30.39409931379691
path: .metrics.mi.mi_original
old: 27.35379373159388
new: 51.97390982659272
path: .metrics.mi.mi_sei
old: -0.8081598586970635
new: 24.23096068720795
Spaces Data
Minimal test - lines (22, 22)
path: .spaces[0].metrics.mi.mi_sei
old: 105.6726654533256
new: null
path: .spaces[0].metrics.mi.mi_visual_studio
old: 73.47834274678662
new: null
path: .spaces[0].metrics.mi.mi_original
old: 125.64796609700514
new: null
path: .spaces[0].metrics.halstead.N2
old: 9.0
new: 1.0
path: .spaces[0].metrics.halstead.effort
old: 401.8516041197334
new: 0.0
path: .spaces[0].metrics.halstead.time
old: 22.325089117762968
new: 0.0
path: .spaces[0].metrics.halstead.n2
old: 7.0
new: 1.0
path: .spaces[0].metrics.halstead.length
old: 20.0
new: 1.0
path: .spaces[0].metrics.halstead.bugs
old: 0.018151919190735624
new: 0.0
path: .spaces[0].metrics.halstead.volume
old: 78.13781191217038
new: 0.0
path: .spaces[0].metrics.halstead.vocabulary
old: 15.0
new: 1.0
path: .spaces[0].metrics.halstead.difficulty
old: 5.142857142857143
new: 0.0
path: .spaces[0].metrics.halstead.level
old: 0.1944444444444444
new: null
path: .spaces[0].metrics.halstead.N1
old: 11.0
new: 0.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 2.1825742227201617
new: null
path: .spaces[0].metrics.halstead.estimated_program_length
old: 43.65148445440323
new: null
path: .spaces[0].metrics.halstead.n1
old: 8.0
new: 0.0
path: .spaces[0].metrics.nom.functions
old: 1.0
new: 0.0
path: .spaces[0].metrics.nom.total
old: 1.0
new: 0.0
path: .spaces[0].metrics.nexits.average
old: 0.0
new: null
path: .spaces[0].metrics.loc.ploc
old: 4.0
new: 1.0
path: .spaces[0].metrics.loc.lloc
old: 1.0
new: 0.0
path: .spaces[0].metrics.loc.sloc
old: 4.0
new: 1.0
path: .spaces[0].metrics.cognitive.average
old: 0.0
new: null
path: .spaces[0].metrics.nargs.average
old: 1.0
new: null
path: .spaces[0].metrics.nargs.sum
old: 1.0
new: 0.0
Code
class nsILoadContext;
Minimal test - lines (41, 107)
path: .spaces[2].metrics.mi.mi_sei
old: 114.2475845735037
new: 27.556557878480668
path: .spaces[2].metrics.mi.mi_visual_studio
old: 76.91290699427772
new: 36.082341809718656
path: .spaces[2].metrics.mi.mi_original
old: 131.5210709602149
new: 61.70080449461889
path: .spaces[2].metrics.loc.sloc
old: 3.0
new: 67.0
path: .spaces[2].metrics.loc.cloc
old: 0.0
new: 2.0
path: .spaces[2].metrics.loc.blank
old: 0.0
new: 14.0
path: .spaces[2].metrics.loc.lloc
old: 1.0
new: 4.0
path: .spaces[2].metrics.loc.ploc
old: 3.0
new: 51.0
path: .spaces[2].metrics.nargs.average
old: 0.0
new: 0.14285714285714285
path: .spaces[2].metrics.nargs.sum
old: 0.0
new: 1.0
path: .spaces[2].metrics.nom.total
old: 1.0
new: 7.0
path: .spaces[2].metrics.nom.functions
old: 1.0
new: 7.0
path: .spaces[2].metrics.halstead.difficulty
old: 6.75
new: 14.450704225352112
path: .spaces[2].metrics.halstead.vocabulary
old: 13.0
new: 89.0
path: .spaces[2].metrics.halstead.estimated_program_length
old: 36.529325012980806
new: 511.69069551079406
path: .spaces[2].metrics.halstead.bugs
old: 0.018085484097870815
new: 0.28913843545118795
path: .spaces[2].metrics.halstead.N2
old: 6.0
new: 114.0
path: .spaces[2].metrics.halstead.length
old: 16.0
new: 273.0
path: .spaces[2].metrics.halstead.volume
old: 59.207035490257475
new: 1767.8752266538263
path: .spaces[2].metrics.halstead.n1
old: 9.0
new: 18.0
path: .spaces[2].metrics.halstead.effort
old: 399.6474895592379
new: 25547.042007701773
path: .spaces[2].metrics.halstead.purity_ratio
old: 2.2830828133113004
new: 1.8743248919809303
path: .spaces[2].metrics.halstead.time
old: 22.202638308846552
new: 1419.2801115389875
path: .spaces[2].metrics.halstead.n2
old: 4.0
new: 71.0
path: .spaces[2].metrics.halstead.level
old: 0.14814814814814814
new: 0.06920077972709551
path: .spaces[2].metrics.halstead.N1
old: 10.0
new: 159.0
path: .spaces[2].metrics.cyclomatic.average
old: 2.0
new: 1.0
path: .spaces[2].metrics.cyclomatic.sum
old: 2.0
new: 10.0
path: .spaces[2].metrics.nexits.sum
old: 1.0
new: 3.0
path: .spaces[2].metrics.nexits.average
old: 1.0
new: 0.42857142857142855
Code
class nsFilePicker : public nsBaseWinFilePicker {
virtual ~nsFilePicker() = default;
public:
nsFilePicker();
NS_IMETHOD Init(mozIDOMWindowProxy* aParent, const nsAString& aTitle,
int16_t aMode) override;
NS_DECL_ISUPPORTS
// nsIFilePicker (less what's in nsBaseFilePicker and nsBaseWinFilePicker)
NS_IMETHOD GetFilterIndex(int32_t* aFilterIndex) override;
NS_IMETHOD SetFilterIndex(int32_t aFilterIndex) override;
NS_IMETHOD GetFile(nsIFile** aFile) override;
NS_IMETHOD GetFileURL(nsIURI** aFileURL) override;
NS_IMETHOD GetFiles(nsISimpleEnumerator** aFiles) override;
NS_IMETHOD AppendFilter(const nsAString& aTitle,
const nsAString& aFilter) override;
protected:
/* method from nsBaseFilePicker */
virtual void InitNative(nsIWidget* aParent, const nsAString& aTitle) override;
nsresult Show(int16_t* aReturnVal) override;
nsresult ShowW(int16_t* aReturnVal);
void GetFilterListArray(nsString& aFilterList);
bool ShowFolderPicker(const nsString& aInitialDir);
bool ShowFilePicker(const nsString& aInitialDir);
void RememberLastUsedDirectory();
bool IsPrivacyModeEnabled();
bool IsDefaultPathLink();
bool IsDefaultPathHtml();
nsCOMPtr mLoadContext;
nsCOMPtr mParentWidget;
nsString mTitle;
nsCString mFile;
nsString mFilterList;
int16_t mSelectedType;
nsCOMArray mFiles;
nsString mUnicodeFile;
struct FreeDeleter {
void operator()(void* aPtr) { ::free(aPtr); }
};
static mozilla::UniquePtr sLastUsedUnicodeDirectory;
class ComDlgFilterSpec {
public:
ComDlgFilterSpec() {}
~ComDlgFilterSpec() {}
const uint32_t Length() { return mSpecList.Length(); }
const bool IsEmpty() { return (mSpecList.Length() == 0); }
const COMDLG_FILTERSPEC* get() { return mSpecList.Elements(); }
void Append(const nsAString& aTitle, const nsAString& aFilter);
private:
AutoTArray mSpecList;
AutoTArray mStrings;
};
ComDlgFilterSpec mComFilterList;
};
Minimal test - lines (24, 35)
path: .spaces[1].metrics.cognitive.sum
old: 1.0
new: 0.0
path: .spaces[1].metrics.cognitive.average
old: 1.0
new: null
path: .spaces[1].metrics.nargs.average
old: 0.0
new: null
path: .spaces[1].metrics.nexits.average
old: 0.0
new: null
path: .spaces[1].metrics.cyclomatic.sum
old: 2.0
new: 1.0
path: .spaces[1].metrics.cyclomatic.average
old: 2.0
new: 1.0
path: .spaces[1].metrics.mi.mi_original
old: 115.08822195489331
new: 103.43482932728838
path: .spaces[1].metrics.mi.mi_visual_studio
old: 67.30305377479142
new: 60.48820428496397
path: .spaces[1].metrics.mi.mi_sei
old: 125.5113883290216
new: 73.625883193067
path: .spaces[1].metrics.nom.total
old: 1.0
new: 0.0
path: .spaces[1].metrics.nom.functions
old: 1.0
new: 0.0
path: .spaces[1].metrics.loc.ploc
old: 6.0
new: 11.0
path: .spaces[1].metrics.loc.blank
old: 0.0
new: 1.0
path: .spaces[1].metrics.loc.cloc
old: 2.0
new: 0.0
path: .spaces[1].metrics.loc.lloc
old: 3.0
new: 0.0
path: .spaces[1].metrics.loc.sloc
old: 8.0
new: 12.0
path: .spaces[1].metrics.halstead.vocabulary
old: 11.0
new: 19.0
path: .spaces[1].metrics.halstead.level
old: 0.1904761904761905
new: 0.23333333333333336
path: .spaces[1].metrics.halstead.bugs
old: 0.01639924478676122
new: 0.02831334996414594
path: .spaces[1].metrics.halstead.N2
old: 6.0
new: 24.0
path: .spaces[1].metrics.halstead.volume
old: 65.72920075410865
new: 182.66088307807416
path: .spaces[1].metrics.halstead.time
old: 19.17101688661502
new: 43.49068644716051
path: .spaces[1].metrics.halstead.estimated_program_length
old: 27.651484454403228
new: 64.91260938324326
path: .spaces[1].metrics.halstead.purity_ratio
old: 1.455341287073854
new: 1.509595567052169
path: .spaces[1].metrics.halstead.n1
old: 7.0
new: 5.0
path: .spaces[1].metrics.halstead.length
old: 19.0
new: 43.0
path: .spaces[1].metrics.halstead.N1
old: 13.0
new: 19.0
path: .spaces[1].metrics.halstead.difficulty
old: 5.25
new: 4.285714285714286
path: .spaces[1].metrics.halstead.n2
old: 4.0
new: 14.0
path: .spaces[1].metrics.halstead.effort
old: 345.0783039590704
new: 782.8323560488892
Code
class nsBaseWinFilePicker : public nsBaseFilePicker {
public:
NS_IMETHOD GetDefaultString(nsAString& aDefaultString) override;
NS_IMETHOD SetDefaultString(const nsAString& aDefaultString) override;
NS_IMETHOD GetDefaultExtension(nsAString& aDefaultExtension) override;
NS_IMETHOD SetDefaultExtension(const nsAString& aDefaultExtension) override;
protected:
nsString mDefaultFilePath;
nsString mDefaultFilename;
nsString mDefaultExtension;
};