Global Metrics
path: .metrics.nargs.average
old: 4.0
new: 0.0
path: .metrics.nargs.sum
old: 8.0
new: 0.0
path: .metrics.mi.mi_original
old: 57.51144535631259
new: 59.614768561319934
path: .metrics.mi.mi_sei
old: 32.38791998790567
new: 48.53139464414215
path: .metrics.mi.mi_visual_studio
old: 33.63242418497812
new: 34.862437755157856
path: .metrics.nexits.sum
old: 5.0
new: 2.0
path: .metrics.nexits.average
old: 2.5
new: 1.0
path: .metrics.halstead.n2
old: 48.0
new: 49.0
path: .metrics.halstead.N2
old: 104.0
new: 100.0
path: .metrics.halstead.bugs
old: 0.3898257742997947
new: 0.2140345297252949
path: .metrics.halstead.length
old: 261.0
new: 206.0
path: .metrics.halstead.effort
old: 39993.34295491882
new: 16270.752774710258
path: .metrics.halstead.estimated_program_length
old: 372.1201250239268
new: 323.22649869747937
path: .metrics.halstead.vocabulary
old: 71.0
new: 62.0
path: .metrics.halstead.difficulty
old: 24.916666666666668
new: 13.26530612244898
path: .metrics.halstead.level
old: 0.04013377926421405
new: 0.07538461538461538
path: .metrics.halstead.n1
old: 23.0
new: 13.0
path: .metrics.halstead.time
old: 2221.852386384379
new: 903.9307097061254
path: .metrics.halstead.N1
old: 157.0
new: 106.0
path: .metrics.halstead.volume
old: 1605.083998190722
new: 1226.5644399396965
path: .metrics.halstead.purity_ratio
old: 1.4257476054556582
new: 1.5690606732887349
path: .metrics.cyclomatic.average
old: 4.0
new: 1.0
path: .metrics.cyclomatic.sum
old: 12.0
new: 5.0
path: .metrics.cognitive.sum
old: 7.0
new: 0.0
path: .metrics.cognitive.average
old: 3.5
new: 0.0
path: .metrics.loc.lloc
old: 29.0
new: 2.0
path: .metrics.loc.sloc
old: 87.0
new: 92.0
path: .metrics.loc.ploc
old: 61.0
new: 48.0
path: .metrics.loc.blank
old: 17.0
new: 16.0
path: .metrics.loc.cloc
old: 9.0
new: 28.0
Spaces Data
Minimal test - lines (33, 90)
path: .spaces[1].metrics.nargs.average
old: 4.0
new: 0.0
path: .spaces[1].metrics.nargs.sum
old: 4.0
new: 0.0
path: .spaces[1].metrics.nom.total
old: 1.0
new: 2.0
path: .spaces[1].metrics.nom.functions
old: 1.0
new: 2.0
path: .spaces[1].metrics.nexits.average
old: 2.0
new: 1.0
path: .spaces[1].metrics.mi.mi_visual_studio
old: 49.22870793651016
new: 39.9437726229994
path: .spaces[1].metrics.mi.mi_original
old: 84.18109057143238
new: 68.30385118532897
path: .spaces[1].metrics.mi.mi_sei
old: 70.84161158999179
new: 59.487085545880994
path: .spaces[1].metrics.cognitive.sum
old: 3.0
new: 0.0
path: .spaces[1].metrics.cognitive.average
old: 3.0
new: 0.0
path: .spaces[1].metrics.halstead.level
old: 0.08359133126934984
new: 0.0671971706454465
path: .spaces[1].metrics.halstead.vocabulary
old: 44.0
new: 51.0
path: .spaces[1].metrics.halstead.purity_ratio
old: 2.0828297985228357
new: 1.3236735927630503
path: .spaces[1].metrics.halstead.N1
old: 57.0
new: 100.0
path: .spaces[1].metrics.halstead.bugs
old: 0.11255166950217547
new: 0.20975791161839372
path: .spaces[1].metrics.halstead.N2
old: 38.0
new: 87.0
path: .spaces[1].metrics.halstead.effort
old: 6204.542933995758
new: 15785.538717775597
path: .spaces[1].metrics.halstead.n1
old: 17.0
new: 13.0
path: .spaces[1].metrics.halstead.difficulty
old: 11.962962962962964
new: 14.88157894736842
path: .spaces[1].metrics.halstead.volume
old: 518.6460037705432
new: 1060.7435389486695
path: .spaces[1].metrics.halstead.estimated_program_length
old: 197.8688308596694
new: 247.52696184669043
path: .spaces[1].metrics.halstead.length
old: 95.0
new: 187.0
path: .spaces[1].metrics.halstead.time
old: 344.69682966643103
new: 876.9743732097553
path: .spaces[1].metrics.halstead.n2
old: 27.0
new: 38.0
path: .spaces[1].metrics.loc.cloc
old: 3.0
new: 16.0
path: .spaces[1].metrics.loc.lloc
old: 8.0
new: 2.0
path: .spaces[1].metrics.loc.ploc
old: 19.0
new: 34.0
path: .spaces[1].metrics.loc.blank
old: 5.0
new: 8.0
path: .spaces[1].metrics.loc.sloc
old: 27.0
new: 58.0
path: .spaces[1].metrics.cyclomatic.sum
old: 4.0
new: 3.0
path: .spaces[1].metrics.cyclomatic.average
old: 4.0
new: 1.0
Code
class nsDataObjCollection final : public nsIDataObjCollection,
public nsDataObj {
public:
nsDataObjCollection();
private:
~nsDataObjCollection() final;
public: // IUnknown methods - see iunknown.h for documentation
STDMETHODIMP_(ULONG) AddRef() final;
STDMETHODIMP QueryInterface(REFIID, void**) final;
STDMETHODIMP_(ULONG) Release() final;
private: // DataGet and DataSet helper methods
HRESULT GetFile(LPFORMATETC pFE, LPSTGMEDIUM pSTM);
HRESULT GetText(LPFORMATETC pFE, LPSTGMEDIUM pSTM);
HRESULT GetFileDescriptors(LPFORMATETC pFE, LPSTGMEDIUM pSTM);
HRESULT GetFileContents(LPFORMATETC pFE, LPSTGMEDIUM pSTM);
HRESULT GetFirstSupporting(LPFORMATETC pFE, LPSTGMEDIUM pSTM);
using nsDataObj::GetFile;
using nsDataObj::GetFileContents;
using nsDataObj::GetText;
// support for clipboard
void AddDataFlavor(const char* aDataFlavor, LPFORMATETC aFE) final;
public: // from nsPIDataObjCollection
void AddDataObject(IDataObject* aDataObj);
int32_t GetNumDataObjects() { return mDataObjects.Length(); }
nsDataObj* GetDataObjectAt(uint32_t aItem) {
return mDataObjects.SafeElementAt(aItem, RefPtr());
}
public:
// Store data in pSTM according to the format specified by pFE, if the
// format is supported (supported formats are specified in CfDragDrop::
// GetFormats) and return NOERROR; otherwise return DATA_E_FORMATETC. It
// is the callers responsibility to free pSTM if NOERROR is returned.
STDMETHODIMP GetData(LPFORMATETC pFE, LPSTGMEDIUM pSTM) final;
// Similar to GetData except that the caller allocates the structure
// referenced by pSTM.
STDMETHODIMP GetDataHere(LPFORMATETC pFE, LPSTGMEDIUM pSTM) final;
// Returns S_TRUE if this object supports the format specified by pSTM,
// S_FALSE otherwise.
STDMETHODIMP QueryGetData(LPFORMATETC pFE) final;
// Set this objects data according to the format specified by pFE and
// the storage medium specified by pSTM and return NOERROR, if the format
// is supported. If release is TRUE this object must release the storage
// associated with pSTM.
STDMETHODIMP SetData(LPFORMATETC pFE, LPSTGMEDIUM pSTM, BOOL release) final;
private:
nsTArray > mDataObjects;
};
Minimal test - lines (23, 25)
path: .spaces[0].metrics.cognitive.average
old: 4.0
new: null
path: .spaces[0].metrics.cognitive.sum
old: 4.0
new: 0.0
path: .spaces[0].metrics.nexits.average
old: 3.0
new: null
path: .spaces[0].metrics.nexits.sum
old: 3.0
new: 0.0
path: .spaces[0].metrics.cyclomatic.sum
old: 7.0
new: 1.0
path: .spaces[0].metrics.cyclomatic.average
old: 7.0
new: 1.0
path: .spaces[0].metrics.nom.total
old: 1.0
new: 0.0
path: .spaces[0].metrics.nom.functions
old: 1.0
new: 0.0
path: .spaces[0].metrics.nargs.sum
old: 4.0
new: 0.0
path: .spaces[0].metrics.nargs.average
old: 4.0
new: null
path: .spaces[0].metrics.halstead.bugs
old: 0.18767217937405656
new: 0.0015471962778709262
path: .spaces[0].metrics.halstead.time
old: 742.1799590389617
new: 0.5555555555555556
path: .spaces[0].metrics.halstead.effort
old: 13359.23926270131
new: 10.0
path: .spaces[0].metrics.halstead.N2
old: 54.0
new: 2.0
path: .spaces[0].metrics.halstead.n2
old: 35.0
new: 2.0
path: .spaces[0].metrics.halstead.vocabulary
old: 56.0
new: 4.0
path: .spaces[0].metrics.halstead.length
old: 142.0
new: 5.0
path: .spaces[0].metrics.halstead.N1
old: 88.0
new: 3.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.9138279681086463
new: 0.8
path: .spaces[0].metrics.halstead.estimated_program_length
old: 271.7635714714278
new: 4.0
path: .spaces[0].metrics.halstead.n1
old: 21.0
new: 2.0
path: .spaces[0].metrics.halstead.difficulty
old: 16.2
new: 1.0
path: .spaces[0].metrics.halstead.level
old: 0.0617283950617284
new: 1.0
path: .spaces[0].metrics.halstead.volume
old: 824.6443989321797
new: 10.0
path: .spaces[0].metrics.loc.cloc
old: 1.0
new: 0.0
path: .spaces[0].metrics.loc.sloc
old: 39.0
new: 3.0
path: .spaces[0].metrics.loc.ploc
old: 32.0
new: 3.0
path: .spaces[0].metrics.loc.lloc
old: 18.0
new: 0.0
path: .spaces[0].metrics.loc.blank
old: 6.0
new: 0.0
path: .spaces[0].metrics.mi.mi_original
old: 75.12254957125393
new: 140.99903844000758
path: .spaces[0].metrics.mi.mi_visual_studio
old: 43.93131553874499
new: 82.45557803509216
path: .spaces[0].metrics.mi.mi_sei
old: 45.66746595380304
new: 127.819581394903
Code
class nsIDataObjCollection : public IUnknown {
public:
};