Global Metrics
path: .metrics.cyclomatic.sum
old: 79.0
new: 107.0
path: .metrics.cyclomatic.average
old: 2.0256410256410255
new: 4.115384615384615
path: .metrics.mi.mi_original
old: -22.208673277126692
new: 0.17341045345260395
path: .metrics.mi.mi_sei
old: -72.92622341020545
new: -30.36248250088067
path: .metrics.mi.mi_visual_studio
old: 0.0
new: 0.1014096219021076
path: .metrics.nexits.average
old: 0.13513513513513514
new: 10.166666666666666
path: .metrics.nexits.sum
old: 5.0
new: 61.0
path: .metrics.loc.lloc
old: 479.0
new: 163.0
path: .metrics.loc.cloc
old: 195.0
new: 112.0
path: .metrics.loc.blank
old: 237.0
new: 54.0
path: .metrics.loc.sloc
old: 1466.0
new: 474.0
path: .metrics.loc.ploc
old: 1034.0
new: 308.0
path: .metrics.nom.functions
old: 35.0
new: 6.0
path: .metrics.nom.total
old: 37.0
new: 6.0
path: .metrics.nom.closures
old: 2.0
new: 0.0
path: .metrics.halstead.N2
old: 3162.0
new: 363.0
path: .metrics.halstead.purity_ratio
old: 0.30310445484674026
new: 1.6050340486170298
path: .metrics.halstead.bugs
old: 17.13661480786923
new: 0.8370098905496379
path: .metrics.halstead.difficulty
old: 204.8259109311741
new: 16.753846153846155
path: .metrics.halstead.effort
old: 11656533.990216505
new: 125828.13710630132
path: .metrics.halstead.level
old: 0.004882194813409234
new: 0.05968778696051423
path: .metrics.halstead.estimated_program_length
old: 2123.2467062014157
new: 1558.4880612071358
path: .metrics.halstead.n2
old: 247.0
new: 195.0
path: .metrics.halstead.N1
old: 3843.0
new: 608.0
path: .metrics.halstead.length
old: 7005.0
new: 971.0
path: .metrics.halstead.n1
old: 32.0
new: 18.0
path: .metrics.halstead.volume
old: 56909.46978936346
new: 7510.403041239288
path: .metrics.halstead.vocabulary
old: 279.0
new: 213.0
path: .metrics.halstead.time
old: 647585.2216786946
new: 6990.452061461185
path: .metrics.nargs.sum
old: 64.0
new: 6.0
path: .metrics.nargs.average
old: 1.7297297297297298
new: 1.0
path: .metrics.cognitive.average
old: 0.945945945945946
new: 1.0
path: .metrics.cognitive.sum
old: 35.0
new: 6.0
Spaces Data
Minimal test - lines (18, 18)
path: .spaces[0].metrics.halstead.estimated_program_length
old: 12.754887502163468
new: null
path: .spaces[0].metrics.halstead.n1
old: 3.0
new: 0.0
path: .spaces[0].metrics.halstead.time
old: 2.573408678552804
new: 0.0
path: .spaces[0].metrics.halstead.bugs
old: 0.004299318203100795
new: 0.0
path: .spaces[0].metrics.halstead.level
old: 0.6666666666666666
new: null
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.1595352274694062
new: null
path: .spaces[0].metrics.halstead.effort
old: 46.321356213950466
new: 0.0
path: .spaces[0].metrics.halstead.length
old: 11.0
new: 1.0
path: .spaces[0].metrics.halstead.n2
old: 4.0
new: 1.0
path: .spaces[0].metrics.halstead.N1
old: 7.0
new: 0.0
path: .spaces[0].metrics.halstead.volume
old: 30.880904142633646
new: 0.0
path: .spaces[0].metrics.halstead.N2
old: 4.0
new: 1.0
path: .spaces[0].metrics.halstead.difficulty
old: 1.5
new: 0.0
path: .spaces[0].metrics.halstead.vocabulary
old: 7.0
new: 1.0
path: .spaces[0].metrics.mi.mi_visual_studio
old: 74.18736151928911
new: null
path: .spaces[0].metrics.mi.mi_original
old: 126.86038819798438
new: null
path: .spaces[0].metrics.mi.mi_sei
old: 154.02377510423386
new: null
path: .spaces[0].metrics.loc.ploc
old: 5.0
new: 1.0
path: .spaces[0].metrics.loc.sloc
old: 5.0
new: 1.0
path: .spaces[0].metrics.loc.cloc
old: 3.0
new: 0.0
Code
class nsCommandParams;
Minimal test - lines (176, 191)
path: .spaces[4].metrics.halstead.effort
old: 6664.20156908517
new: 1326.3641519943344
path: .spaces[4].metrics.halstead.purity_ratio
old: 1.831928469504774
new: 1.6022638862533347
path: .spaces[4].metrics.halstead.vocabulary
old: 43.0
new: 24.0
path: .spaces[4].metrics.halstead.N2
old: 48.0
new: 15.0
path: .spaces[4].metrics.halstead.bugs
old: 0.11804406636993477
new: 0.04023962538837978
path: .spaces[4].metrics.halstead.length
old: 106.0
new: 54.0
path: .spaces[4].metrics.halstead.time
old: 370.23342050473167
new: 73.68689733301858
path: .spaces[4].metrics.halstead.n2
old: 29.0
new: 14.0
path: .spaces[4].metrics.halstead.n1
old: 14.0
new: 10.0
path: .spaces[4].metrics.halstead.N1
old: 58.0
new: 39.0
path: .spaces[4].metrics.halstead.volume
old: 575.1840639984224
new: 247.58797503894243
path: .spaces[4].metrics.halstead.difficulty
old: 11.586206896551724
new: 5.357142857142857
path: .spaces[4].metrics.halstead.level
old: 0.08630952380952381
new: 0.18666666666666668
path: .spaces[4].metrics.halstead.estimated_program_length
old: 194.18441776750603
new: 86.52224985768008
path: .spaces[4].metrics.loc.lloc
old: 3.0
new: 13.0
path: .spaces[4].metrics.loc.cloc
old: 6.0
new: 1.0
path: .spaces[4].metrics.loc.ploc
old: 17.0
new: 16.0
path: .spaces[4].metrics.loc.sloc
old: 22.0
new: 16.0
path: .spaces[4].metrics.mi.mi_sei
old: 86.80547274012011
new: 81.43506512380861
path: .spaces[4].metrics.mi.mi_original
old: 87.4207237310491
new: 95.1228796372426
path: .spaces[4].metrics.mi.mi_visual_studio
old: 51.123230252075494
new: 55.627414992539535
path: .spaces[4].metrics.cognitive.average
old: 0.0
new: 1.0
path: .spaces[4].metrics.cognitive.sum
old: 0.0
new: 1.0
path: .spaces[4].metrics.nargs.sum
old: 2.0
new: 1.0
path: .spaces[4].metrics.nargs.average
old: 2.0
new: 1.0
path: .spaces[4].metrics.nexits.sum
old: 0.0
new: 2.0
path: .spaces[4].metrics.nexits.average
old: 0.0
new: 2.0
path: .spaces[4].metrics.cyclomatic.average
old: 2.0
new: 10.0
path: .spaces[4].metrics.cyclomatic.sum
old: 2.0
new: 10.0
Code
inline bool IsDataAvailableOnHTMLEditor(EditorInputType aInputType) {
switch (aInputType) {
case EditorInputType::eInsertText:
case EditorInputType::eInsertCompositionText:
case EditorInputType::eInsertFromComposition: // Only level 2
case EditorInputType::eFormatSetBlockTextDirection:
case EditorInputType::eFormatSetInlineTextDirection:
case EditorInputType::eInsertLink:
case EditorInputType::eFormatBackColor:
case EditorInputType::eFormatFontColor:
case EditorInputType::eFormatFontName:
return true;
default:
return false;
}
}
Minimal test - lines (240, 353)
path: .spaces[7].metrics.cyclomatic.average
old: 3.0
new: 51.0
path: .spaces[7].metrics.cyclomatic.sum
old: 3.0
new: 51.0
path: .spaces[7].metrics.cognitive.average
old: 2.0
new: 1.0
path: .spaces[7].metrics.cognitive.sum
old: 2.0
new: 1.0
path: .spaces[7].metrics.loc.ploc
old: 27.0
new: 110.0
path: .spaces[7].metrics.loc.cloc
old: 2.0
new: 18.0
path: .spaces[7].metrics.loc.lloc
old: 13.0
new: 107.0
path: .spaces[7].metrics.loc.sloc
old: 33.0
new: 114.0
path: .spaces[7].metrics.loc.blank
old: 4.0
new: 0.0
path: .spaces[7].metrics.halstead.estimated_program_length
old: 371.48151536929834
new: 385.12968771735893
path: .spaces[7].metrics.halstead.effort
old: 15918.926703278566
new: 25180.44515359671
path: .spaces[7].metrics.halstead.level
old: 0.07046070460704608
new: 0.09493161705551086
path: .spaces[7].metrics.halstead.bugs
old: 0.21093789155485032
new: 0.2863657105533752
path: .spaces[7].metrics.halstead.n1
old: 18.0
new: 11.0
path: .spaces[7].metrics.halstead.n2
old: 52.0
new: 59.0
path: .spaces[7].metrics.halstead.N2
old: 82.0
new: 113.0
path: .spaces[7].metrics.halstead.volume
old: 1121.6587921009288
new: 2390.420376608537
path: .spaces[7].metrics.halstead.purity_ratio
old: 2.029953635897805
new: 0.9875120197881
path: .spaces[7].metrics.halstead.length
old: 183.0
new: 390.0
path: .spaces[7].metrics.halstead.N1
old: 101.0
new: 277.0
path: .spaces[7].metrics.halstead.time
old: 884.3848168488092
new: 1398.9136196442616
path: .spaces[7].metrics.halstead.difficulty
old: 14.192307692307692
new: 10.533898305084746
path: .spaces[7].metrics.mi.mi_original
old: 77.14924505279457
new: 42.0916176358929
path: .spaces[7].metrics.mi.mi_visual_studio
old: 45.11651757473366
new: 24.61498107362158
path: .spaces[7].metrics.mi.mi_sei
old: 54.51775817724325
new: 19.08922276671034
path: .spaces[7].metrics.nexits.sum
old: 0.0
new: 51.0
path: .spaces[7].metrics.nexits.average
old: 0.0
new: 51.0
path: .spaces[7].metrics.nargs.sum
old: 2.0
new: 1.0
path: .spaces[7].metrics.nargs.average
old: 2.0
new: 1.0
Code
inline bool IsCancelableBeforeInputEvent(EditorInputType aInputType) {
switch (aInputType) {
case EditorInputType::eInsertText:
return true; // In Level 1, undefined.
case EditorInputType::eInsertReplacementText:
return true; // In Level 1, undefined.
case EditorInputType::eInsertLineBreak:
return true; // In Level 1, undefined.
case EditorInputType::eInsertParagraph:
return true; // In Level 1, undefined.
case EditorInputType::eInsertOrderedList:
return true;
case EditorInputType::eInsertUnorderedList:
return true;
case EditorInputType::eInsertHorizontalRule:
return true;
case EditorInputType::eInsertFromYank:
return true;
case EditorInputType::eInsertFromDrop:
return true;
case EditorInputType::eInsertFromPaste:
return true;
case EditorInputType::eInsertFromPasteAsQuotation:
return true;
case EditorInputType::eInsertTranspose:
return true;
case EditorInputType::eInsertCompositionText:
return false;
case EditorInputType::eInsertFromComposition:
MOZ_ASSERT(!StaticPrefs::dom_input_events_conform_to_level_1());
return true;
case EditorInputType::eInsertLink:
return true;
case EditorInputType::eDeleteByComposition:
MOZ_ASSERT(!StaticPrefs::dom_input_events_conform_to_level_1());
return true;
case EditorInputType::eDeleteCompositionText:
MOZ_ASSERT(!StaticPrefs::dom_input_events_conform_to_level_1());
return false;
case EditorInputType::eDeleteWordBackward:
return true; // In Level 1, undefined.
case EditorInputType::eDeleteWordForward:
return true; // In Level 1, undefined.
case EditorInputType::eDeleteSoftLineBackward:
return true; // In Level 1, undefined.
case EditorInputType::eDeleteSoftLineForward:
return true; // In Level 1, undefined.
case EditorInputType::eDeleteEntireSoftLine:
return true; // In Level 1, undefined.
case EditorInputType::eDeleteHardLineBackward:
return true; // In Level 1, undefined.
case EditorInputType::eDeleteHardLineForward:
return true; // In Level 1, undefined.
case EditorInputType::eDeleteByDrag:
return true;
case EditorInputType::eDeleteByCut:
return true;
case EditorInputType::eDeleteContent:
return true; // In Level 1, undefined.
case EditorInputType::eDeleteContentBackward:
return true; // In Level 1, undefined.
case EditorInputType::eDeleteContentForward:
return true; // In Level 1, undefined.
case EditorInputType::eHistoryUndo:
return true;
case EditorInputType::eHistoryRedo:
return true;
case EditorInputType::eFormatBold:
return true;
case EditorInputType::eFormatItalic:
return true;
case EditorInputType::eFormatUnderline:
return true;
case EditorInputType::eFormatStrikeThrough:
return true;
case EditorInputType::eFormatSuperscript:
return true;
case EditorInputType::eFormatSubscript:
return true;
case EditorInputType::eFormatJustifyFull:
return true;
case EditorInputType::eFormatJustifyCenter:
return true;
case EditorInputType::eFormatJustifyRight:
return true;
case EditorInputType::eFormatJustifyLeft:
return true;
case EditorInputType::eFormatIndent:
return true;
case EditorInputType::eFormatOutdent:
return true;
case EditorInputType::eFormatRemove:
return true;
case EditorInputType::eFormatSetBlockTextDirection:
return true;
case EditorInputType::eFormatSetInlineTextDirection:
return true;
case EditorInputType::eFormatBackColor:
return true;
case EditorInputType::eFormatFontColor:
return true;
case EditorInputType::eFormatFontName:
return true;
case EditorInputType::eUnknown:
// This is not declared by Input Events, but it does not make sense to
// allow web apps to cancel default action without inputType value check.
// If some our specific edit actions should be cancelable, new inputType
// value for them should be declared by the spec.
return false;
default:
MOZ_ASSERT_UNREACHABLE("The new input type is not handled");
return false;
}
}
Minimal test - lines (218, 229)
path: .spaces[6].metrics.loc.ploc
old: 23.0
new: 10.0
path: .spaces[6].metrics.loc.sloc
old: 31.0
new: 12.0
path: .spaces[6].metrics.loc.lloc
old: 12.0
new: 7.0
path: .spaces[6].metrics.loc.blank
old: 6.0
new: 0.0
path: .spaces[6].metrics.nargs.average
old: 2.0
new: 1.0
path: .spaces[6].metrics.nargs.sum
old: 2.0
new: 1.0
path: .spaces[6].metrics.cyclomatic.average
old: 1.0
new: 4.0
path: .spaces[6].metrics.cyclomatic.sum
old: 1.0
new: 4.0
path: .spaces[6].metrics.cognitive.sum
old: 0.0
new: 1.0
path: .spaces[6].metrics.cognitive.average
old: 0.0
new: 1.0
path: .spaces[6].metrics.mi.mi_visual_studio
old: 46.53689553634223
new: 61.2357988460806
path: .spaces[6].metrics.mi.mi_original
old: 79.57809136714522
new: 104.71321602679782
path: .spaces[6].metrics.mi.mi_sei
old: 58.37884098860836
new: 105.33202078376571
path: .spaces[6].metrics.halstead.purity_ratio
old: 1.9454861954900573
new: 1.9073093649624544
path: .spaces[6].metrics.halstead.level
old: 0.09001956947162428
new: 0.17777777777777778
path: .spaces[6].metrics.halstead.vocabulary
old: 60.0
new: 18.0
path: .spaces[6].metrics.halstead.N1
old: 85.0
new: 21.0
path: .spaces[6].metrics.halstead.N2
old: 73.0
new: 9.0
path: .spaces[6].metrics.halstead.volume
old: 933.288714106146
new: 125.09775004326936
path: .spaces[6].metrics.halstead.time
old: 575.9789044785514
new: 39.09304688852168
path: .spaces[6].metrics.halstead.length
old: 158.0
new: 30.0
path: .spaces[6].metrics.halstead.n2
old: 46.0
new: 8.0
path: .spaces[6].metrics.halstead.difficulty
old: 11.108695652173912
new: 5.625
path: .spaces[6].metrics.halstead.estimated_program_length
old: 307.38681888742906
new: 57.219280948873624
path: .spaces[6].metrics.halstead.bugs
old: 0.15848863815237038
new: 0.02637100993032116
path: .spaces[6].metrics.halstead.effort
old: 10367.620280613924
new: 703.6748439933903
path: .spaces[6].metrics.halstead.n1
old: 14.0
new: 10.0
path: .spaces[6].metrics.nexits.average
old: 0.0
new: 2.0
path: .spaces[6].metrics.nexits.sum
old: 0.0
new: 2.0
Code
inline bool MayHaveTargetRangesOnHTMLEditor(EditorInputType aInputType) {
switch (aInputType) {
// Explicitly documented by the specs.
case EditorInputType::eHistoryRedo:
case EditorInputType::eHistoryUndo:
// Not documented, but other browsers use empty array.
case EditorInputType::eFormatSetBlockTextDirection:
return false;
default:
return true;
}
}
Minimal test - lines (139, 147)
path: .spaces[2].metrics.halstead.N2
old: 55.0
new: 8.0
path: .spaces[2].metrics.halstead.purity_ratio
old: 1.851710652247735
new: 2.0334909770491096
path: .spaces[2].metrics.halstead.time
old: 669.9654672202126
new: 33.737788530955186
path: .spaces[2].metrics.halstead.bugs
old: 0.17529197221485393
new: 0.02390405007110428
path: .spaces[2].metrics.halstead.effort
old: 12059.378409963829
new: 607.2801935571933
path: .spaces[2].metrics.halstead.n2
old: 34.0
new: 7.0
path: .spaces[2].metrics.halstead.difficulty
old: 15.367647058823527
new: 5.714285714285714
path: .spaces[2].metrics.halstead.estimated_program_length
old: 253.68435935793968
new: 52.87076540327685
path: .spaces[2].metrics.halstead.level
old: 0.06507177033492823
new: 0.175
path: .spaces[2].metrics.halstead.volume
old: 784.7251022751582
new: 106.27403387250882
path: .spaces[2].metrics.halstead.n1
old: 19.0
new: 10.0
path: .spaces[2].metrics.halstead.length
old: 137.0
new: 26.0
path: .spaces[2].metrics.halstead.N1
old: 82.0
new: 18.0
path: .spaces[2].metrics.halstead.vocabulary
old: 53.0
new: 17.0
path: .spaces[2].metrics.cyclomatic.sum
old: 8.0
new: 3.0
path: .spaces[2].metrics.cyclomatic.average
old: 2.0
new: 3.0
path: .spaces[2].metrics.nom.total
old: 3.0
new: 1.0
path: .spaces[2].metrics.nom.functions
old: 3.0
new: 1.0
path: .spaces[2].metrics.loc.sloc
old: 26.0
new: 9.0
path: .spaces[2].metrics.loc.ploc
old: 21.0
new: 9.0
path: .spaces[2].metrics.loc.blank
old: 5.0
new: 0.0
path: .spaces[2].metrics.loc.lloc
old: 4.0
new: 6.0
path: .spaces[2].metrics.nargs.sum
old: 2.0
new: 1.0
path: .spaces[2].metrics.nargs.average
old: 0.6666666666666666
new: 1.0
path: .spaces[2].metrics.nexits.average
old: 1.0
new: 2.0
path: .spaces[2].metrics.nexits.sum
old: 3.0
new: 2.0
path: .spaces[2].metrics.cognitive.sum
old: 4.0
new: 1.0
path: .spaces[2].metrics.cognitive.average
old: 1.3333333333333333
new: 1.0
path: .spaces[2].metrics.mi.mi_original
old: 81.71910204905996
new: 110.45165273358803
path: .spaces[2].metrics.mi.mi_sei
old: 43.00945015530091
new: 83.95265924293803
path: .spaces[2].metrics.mi.mi_visual_studio
old: 47.78894856670173
new: 64.591609785724
Code
inline bool ExposesClipboardDataOrDataTransfer(EditorInputType aInputType) {
switch (aInputType) {
case EditorInputType::eInsertFromPaste:
case EditorInputType::eInsertFromPasteAsQuotation:
return true;
default:
return false;
}
}
Minimal test - lines (197, 209)
path: .spaces[5].metrics.cyclomatic.sum
old: 2.0
new: 7.0
path: .spaces[5].metrics.cyclomatic.average
old: 2.0
new: 7.0
path: .spaces[5].metrics.mi.mi_visual_studio
old: 45.569334426302014
new: 58.89279656516549
path: .spaces[5].metrics.mi.mi_original
old: 77.92356186897645
new: 100.70668212643298
path: .spaces[5].metrics.mi.mi_sei
old: 59.76036807257039
new: 70.30091791200458
path: .spaces[5].metrics.nargs.sum
old: 2.0
new: 1.0
path: .spaces[5].metrics.nargs.average
old: 2.0
new: 1.0
path: .spaces[5].metrics.nexits.sum
old: 0.0
new: 2.0
path: .spaces[5].metrics.nexits.average
old: 0.0
new: 2.0
path: .spaces[5].metrics.halstead.n1
old: 13.0
new: 10.0
path: .spaces[5].metrics.halstead.purity_ratio
old: 1.598886594256385
new: 1.6969768750924736
path: .spaces[5].metrics.halstead.N1
old: 104.0
new: 30.0
path: .spaces[5].metrics.halstead.N2
old: 85.0
new: 12.0
path: .spaces[5].metrics.halstead.vocabulary
old: 59.0
new: 21.0
path: .spaces[5].metrics.halstead.bugs
old: 0.18762235364773192
new: 0.033471855994458254
path: .spaces[5].metrics.halstead.effort
old: 13353.919430912758
new: 1006.2399914002252
path: .spaces[5].metrics.halstead.length
old: 189.0
new: 42.0
path: .spaces[5].metrics.halstead.n2
old: 46.0
new: 11.0
path: .spaces[5].metrics.halstead.level
old: 0.08325791855203621
new: 0.18333333333333335
path: .spaces[5].metrics.halstead.estimated_program_length
old: 302.1895663144568
new: 71.27302875388389
path: .spaces[5].metrics.halstead.time
old: 741.8844128284866
new: 55.90222174445695
path: .spaces[5].metrics.halstead.volume
old: 1111.819536329388
new: 184.4773317567079
path: .spaces[5].metrics.halstead.difficulty
old: 12.01086956521739
new: 5.454545454545454
path: .spaces[5].metrics.loc.cloc
old: 3.0
new: 0.0
path: .spaces[5].metrics.loc.blank
old: 4.0
new: 0.0
path: .spaces[5].metrics.loc.sloc
old: 32.0
new: 13.0
path: .spaces[5].metrics.loc.ploc
old: 25.0
new: 13.0
path: .spaces[5].metrics.loc.lloc
old: 13.0
new: 10.0
Code
inline bool IsDataTransferAvailableOnHTMLEditor(EditorInputType aInputType) {
switch (aInputType) {
case EditorInputType::eInsertFromPaste:
case EditorInputType::eInsertFromPasteAsQuotation:
case EditorInputType::eInsertFromDrop:
case EditorInputType::eInsertTranspose:
case EditorInputType::eInsertReplacementText:
case EditorInputType::eInsertFromYank:
return true;
default:
return false;
}
}
Minimal test - lines (39, 105)
path: .spaces[1].metrics.halstead.length
old: 50.0
new: 115.0
path: .spaces[1].metrics.halstead.effort
old: 1729.4749852191371
new: 4538.683785383965
path: .spaces[1].metrics.halstead.estimated_program_length
old: 71.54887502163469
new: 227.95057052383703
path: .spaces[1].metrics.halstead.time
old: 96.0819436232854
new: 252.14909918799808
path: .spaces[1].metrics.halstead.level
old: 0.12698412698412698
new: 0.14074074074074072
path: .spaces[1].metrics.halstead.volume
old: 219.61587113893805
new: 638.7777179429283
path: .spaces[1].metrics.halstead.vocabulary
old: 21.0
new: 47.0
path: .spaces[1].metrics.halstead.purity_ratio
old: 1.4309775004326937
new: 1.9821788741203223
path: .spaces[1].metrics.halstead.n2
old: 12.0
new: 38.0
path: .spaces[1].metrics.halstead.N1
old: 29.0
new: 55.0
path: .spaces[1].metrics.halstead.N2
old: 21.0
new: 60.0
path: .spaces[1].metrics.halstead.bugs
old: 0.04802731065671358
new: 0.09137597612054814
path: .spaces[1].metrics.halstead.difficulty
old: 7.875
new: 7.105263157894737
path: .spaces[1].metrics.cyclomatic.sum
old: 2.0
new: 1.0
path: .spaces[1].metrics.nargs.average
old: 0.0
new: null
path: .spaces[1].metrics.loc.blank
old: 1.0
new: 22.0
path: .spaces[1].metrics.loc.ploc
old: 9.0
new: 33.0
path: .spaces[1].metrics.loc.cloc
old: 0.0
new: 12.0
path: .spaces[1].metrics.loc.sloc
old: 10.0
new: 67.0
path: .spaces[1].metrics.loc.lloc
old: 2.0
new: 1.0
path: .spaces[1].metrics.nexits.average
old: 0.5
new: null
path: .spaces[1].metrics.nexits.sum
old: 1.0
new: 0.0
path: .spaces[1].metrics.cognitive.average
old: 0.0
new: null
path: .spaces[1].metrics.mi.mi_sei
old: 76.27480462033601
new: 54.52260880700632
path: .spaces[1].metrics.mi.mi_original
old: 105.20034559765352
new: 69.06428558586197
path: .spaces[1].metrics.mi.mi_visual_studio
old: 61.520669940148245
new: 40.388471102843255
path: .spaces[1].metrics.nom.closures
old: 1.0
new: 0.0
path: .spaces[1].metrics.nom.total
old: 2.0
new: 0.0
path: .spaces[1].metrics.nom.functions
old: 1.0
new: 0.0
Code
namespace mozilla {
enum class CanBubble { eYes, eNo };
enum class Cancelable { eYes, eNo };
enum class ChromeOnlyDispatch { eYes, eNo };
enum class Trusted { eYes, eNo };
enum class Composed { eYes, eNo, eDefault };
/**
* Event messages
*/
typedef uint16_t EventMessageType;
enum EventMessage : EventMessageType {
#define NS_EVENT_MESSAGE(aMessage) aMessage,
#define NS_EVENT_MESSAGE_FIRST_LAST(aMessage, aFirst, aLast) \
aMessage##First = aFirst, aMessage##Last = aLast,
#include "mozilla/EventMessageList.h"
#undef NS_EVENT_MESSAGE
#undef NS_EVENT_MESSAGE_FIRST_LAST
// For preventing bustage due to "," after the last item.
eEventMessage_MaxValue
};
const char* ToChar(EventMessage aEventMessage);
/**
* Event class IDs
*/
typedef uint8_t EventClassIDType;
enum EventClassID : EventClassIDType {
// The event class name will be:
// eBasicEventClass for WidgetEvent
// eFooEventClass for WidgetFooEvent or InternalFooEvent
#define NS_ROOT_EVENT_CLASS(aPrefix, aName) eBasic##aName##Class
#define NS_EVENT_CLASS(aPrefix, aName) , e##aName##Class
#include "mozilla/EventClassList.h"
#undef NS_EVENT_CLASS
#undef NS_ROOT_EVENT_CLASS
};
const char* ToChar(EventClassID aEventClassID);
typedef uint16_t Modifiers;
#define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) KEY_NAME_INDEX_##aCPPName,
typedef uint16_t KeyNameIndexType;
enum KeyNameIndex : KeyNameIndexType {
#include "mozilla/KeyNameList.h"
// If a DOM keyboard event is synthesized by script, this is used. Then,
// specified key name should be stored and use it as .key value.
KEY_NAME_INDEX_USE_STRING
};
Minimal test - lines (153, 170)
path: .spaces[3].metrics.cognitive.sum
old: 0.0
new: 1.0
path: .spaces[3].metrics.cognitive.average
old: 0.0
new: 1.0
path: .spaces[3].metrics.mi.mi_sei
old: 98.84084096343476
new: 75.9692507963135
path: .spaces[3].metrics.mi.mi_visual_studio
old: 53.19695120443815
new: 53.746822924335575
path: .spaces[3].metrics.mi.mi_original
old: 90.96678655958924
new: 91.90706720061384
path: .spaces[3].metrics.nargs.average
old: 2.0
new: 1.0
path: .spaces[3].metrics.nargs.sum
old: 2.0
new: 1.0
path: .spaces[3].metrics.halstead.time
old: 181.19514283359405
new: 86.01151845348456
path: .spaces[3].metrics.halstead.length
old: 79.0
new: 62.0
path: .spaces[3].metrics.halstead.vocabulary
old: 31.0
new: 26.0
path: .spaces[3].metrics.halstead.level
old: 0.12
new: 0.18823529411764703
path: .spaces[3].metrics.halstead.N2
old: 35.0
new: 17.0
path: .spaces[3].metrics.halstead.estimated_program_length
old: 125.4579468272276
new: 97.21928094887365
path: .spaces[3].metrics.halstead.volume
old: 391.3815085205631
new: 291.4272625247477
path: .spaces[3].metrics.halstead.n2
old: 21.0
new: 16.0
path: .spaces[3].metrics.halstead.N1
old: 44.0
new: 45.0
path: .spaces[3].metrics.halstead.bugs
old: 0.07330913859967017
new: 0.04460992487605961
path: .spaces[3].metrics.halstead.purity_ratio
old: 1.5880752762940202
new: 1.56805291853022
path: .spaces[3].metrics.halstead.difficulty
old: 8.333333333333334
new: 5.3125
path: .spaces[3].metrics.halstead.effort
old: 3261.5125710046927
new: 1548.207332162722
path: .spaces[3].metrics.loc.ploc
old: 16.0
new: 18.0
path: .spaces[3].metrics.loc.lloc
old: 1.0
new: 15.0
path: .spaces[3].metrics.loc.cloc
old: 9.0
new: 1.0
path: .spaces[3].metrics.loc.sloc
old: 20.0
new: 18.0
path: .spaces[3].metrics.cyclomatic.sum
old: 2.0
new: 12.0
path: .spaces[3].metrics.cyclomatic.average
old: 2.0
new: 12.0
path: .spaces[3].metrics.nexits.average
old: 0.0
new: 2.0
path: .spaces[3].metrics.nexits.sum
old: 0.0
new: 2.0
Code
inline bool IsDataAvailableOnTextEditor(EditorInputType aInputType) {
switch (aInputType) {
case EditorInputType::eInsertText:
case EditorInputType::eInsertCompositionText:
case EditorInputType::eInsertFromComposition: // Only level 2
case EditorInputType::eInsertFromPaste:
case EditorInputType::eInsertFromPasteAsQuotation:
case EditorInputType::eInsertTranspose:
case EditorInputType::eInsertFromDrop:
case EditorInputType::eInsertReplacementText:
case EditorInputType::eInsertFromYank:
case EditorInputType::eFormatSetBlockTextDirection:
case EditorInputType::eFormatSetInlineTextDirection:
return true;
default:
return false;
}
}
Minimal test - lines (392, 472)
path: .spaces[8].metrics.nom.total
old: 1.0
new: 0.0
path: .spaces[8].metrics.nom.functions
old: 1.0
new: 0.0
path: .spaces[8].metrics.halstead.n2
old: 46.0
new: 60.0
path: .spaces[8].metrics.halstead.N1
old: 93.0
new: 75.0
path: .spaces[8].metrics.halstead.difficulty
old: 13.858695652173912
new: 5.916666666666667
path: .spaces[8].metrics.halstead.time
old: 773.1481640179239
new: 294.14883219283115
path: .spaces[8].metrics.halstead.purity_ratio
old: 1.9260161802373712
new: 2.655018607434142
path: .spaces[8].metrics.halstead.volume
old: 1004.183027147986
new: 894.8753204739651
path: .spaces[8].metrics.halstead.bugs
old: 0.192857071573191
new: 0.10126013476204689
path: .spaces[8].metrics.halstead.N2
old: 75.0
new: 71.0
path: .spaces[8].metrics.halstead.vocabulary
old: 63.0
new: 70.0
path: .spaces[8].metrics.halstead.level
old: 0.07215686274509804
new: 0.16901408450704225
path: .spaces[8].metrics.halstead.effort
old: 13916.66695232263
new: 5294.67897947096
path: .spaces[8].metrics.halstead.length
old: 168.0
new: 146.0
path: .spaces[8].metrics.halstead.estimated_program_length
old: 323.57071827987835
new: 387.6327166853848
path: .spaces[8].metrics.halstead.n1
old: 17.0
new: 10.0
path: .spaces[8].metrics.loc.ploc
old: 26.0
new: 50.0
path: .spaces[8].metrics.loc.lloc
old: 13.0
new: 0.0
path: .spaces[8].metrics.loc.cloc
old: 3.0
new: 11.0
path: .spaces[8].metrics.loc.sloc
old: 33.0
new: 81.0
path: .spaces[8].metrics.loc.blank
old: 4.0
new: 20.0
path: .spaces[8].metrics.mi.mi_sei
old: 59.25233485567541
new: 40.41505144527741
path: .spaces[8].metrics.mi.mi_visual_studio
old: 45.45294952044234
new: 35.413546669444486
path: .spaces[8].metrics.mi.mi_original
old: 77.7245436799564
new: 60.55716480475007
path: .spaces[8].metrics.cognitive.sum
old: 2.0
new: 0.0
path: .spaces[8].metrics.cognitive.average
old: 2.0
new: null
path: .spaces[8].metrics.nargs.sum
old: 2.0
new: 0.0
path: .spaces[8].metrics.nargs.average
old: 2.0
new: null
path: .spaces[8].metrics.cyclomatic.average
old: 3.0
new: 1.0
path: .spaces[8].metrics.cyclomatic.sum
old: 3.0
new: 17.0
path: .spaces[8].metrics.nexits.average
old: 0.0
new: null
Code
namespace mozilla {
template
class OwningNonNull;
namespace dom {
class StaticRange;
}
#define NS_EVENT_CLASS(aPrefix, aName) class aPrefix##aName;
#define NS_ROOT_EVENT_CLASS(aPrefix, aName) NS_EVENT_CLASS(aPrefix, aName)
#include "mozilla/EventClassList.h"
#undef NS_EVENT_CLASS
#undef NS_ROOT_EVENT_CLASS
// BasicEvents.h
struct BaseEventFlags;
struct EventFlags;
class WidgetEventTime;
class NativeEventData;
// TextEvents.h
enum class AccessKeyType;
struct AlternativeCharCode;
struct ShortcutKeyCandidate;
typedef nsTArray ShortcutKeyCandidateArray;
typedef AutoTArray AutoShortcutKeyCandidateArray;
// TextRange.h
typedef uint8_t RawTextRangeType;
enum class TextRangeType : RawTextRangeType;
struct TextRangeStyle;
struct TextRange;
class EditCommands;
class TextRangeArray;
typedef nsTArray> OwningNonNullStaticRangeArray;
// FontRange.h
struct FontRange;
enum MouseButton : int16_t {
eNotPressed = -1,
ePrimary = 0,
eMiddle = 1,
eSecondary = 2,
eX1 = 3, // Typically, "back" button
eX2 = 4, // Typically, "forward" button
};
enum MouseButtonsFlag {
eNoButtons = 0x00,
ePrimaryFlag = 0x01,
eSecondaryFlag = 0x02,
eMiddleFlag = 0x04,
// typicall, "back" button being left side of 5-button
// mice, see "buttons" attribute document of DOM3 Events.
e4thFlag = 0x08,
// typicall, "forward" button being right side of 5-button
// mice, see "buttons" attribute document of DOM3 Events.
e5thFlag = 0x10
};
enum class TextRangeType : RawTextRangeType;
// IMEData.h
template
class StartAndEndOffsets;
template
class OffsetAndData;
} // namespace mozilla