Global Metrics

path: .metrics.cognitive.average
old: 1.75
new: 0.25

path: .metrics.cognitive.sum
old: 21.0
new: 1.0

path: .metrics.halstead.n1
old: 14.0
new: 18.0

path: .metrics.halstead.volume
old: 3516.8572508221177
new: 1649.976259804514

path: .metrics.halstead.vocabulary
old: 72.0
new: 67.0

path: .metrics.halstead.level
old: 0.03314285714285714
new: 0.04390681003584229

path: .metrics.halstead.purity_ratio
old: 0.6895892396950976
new: 1.287424383777966

path: .metrics.halstead.length
old: 570.0
new: 272.0

path: .metrics.halstead.n2
old: 58.0
new: 49.0

path: .metrics.halstead.difficulty
old: 30.17241379310345
new: 22.77551020408163

path: .metrics.halstead.effort
old: 106112.07222308114
new: 37579.05114167016

path: .metrics.halstead.time
old: 5895.115123504507
new: 2087.72506342612

path: .metrics.halstead.bugs
old: 0.747116983873178
new: 0.373975041194977

path: .metrics.halstead.N2
old: 250.0
new: 124.0

path: .metrics.halstead.estimated_program_length
old: 393.0658666262056
new: 350.17943238760677

path: .metrics.halstead.N1
old: 320.0
new: 148.0

path: .metrics.cyclomatic.sum
old: 34.0
new: 6.0

path: .metrics.cyclomatic.average
old: 2.6153846153846154
new: 1.2

path: .metrics.loc.blank
old: 37.0
new: 15.0

path: .metrics.loc.ploc
old: 138.0
new: 53.0

path: .metrics.loc.lloc
old: 67.0
new: 20.0

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

path: .metrics.loc.cloc
old: 151.0
new: 10.0

path: .metrics.nargs.sum
old: 15.0
new: 8.0

path: .metrics.nargs.average
old: 1.25
new: 2.0

path: .metrics.nom.total
old: 12.0
new: 4.0

path: .metrics.nom.functions
old: 12.0
new: 4.0

path: .metrics.nexits.average
old: 1.5833333333333333
new: 0.75

path: .metrics.nexits.sum
old: 19.0
new: 3.0

path: .metrics.mi.mi_original
old: 26.97258259662547
new: 60.517032877900576

path: .metrics.mi.mi_sei
old: 10.153236172560312
new: 38.55211404495091

path: .metrics.mi.mi_visual_studio
old: 15.773440114985656
new: 35.390077706374605

Spaces Data

Minimal test - lines (11, 19)

path: .spaces[0].metrics.loc.sloc
old: 13.0
new: 9.0

path: .spaces[0].metrics.loc.blank
old: 2.0
new: 0.0

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

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

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

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

path: .spaces[0].metrics.nargs.sum
old: 2.0
new: 3.0

path: .spaces[0].metrics.nargs.average
old: 2.0
new: 3.0

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

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

path: .spaces[0].metrics.halstead.bugs
old: 0.038700069453243655
new: 0.05034751189272589

path: .spaces[0].metrics.halstead.difficulty
old: 9.375
new: 8.625

path: .spaces[0].metrics.halstead.purity_ratio
old: 1.7881025296523008
new: 1.4601811228905035

path: .spaces[0].metrics.halstead.N1
old: 17.0
new: 26.0

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

path: .spaces[0].metrics.halstead.volume
old: 133.437600046154
new: 215.22355371615927

path: .spaces[0].metrics.halstead.vocabulary
old: 18.0
new: 21.0

path: .spaces[0].metrics.halstead.effort
old: 1250.9775004326937
new: 1856.3031508018737

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

path: .spaces[0].metrics.halstead.estimated_program_length
old: 57.219280948873624
new: 71.54887502163469

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

path: .spaces[0].metrics.halstead.level
old: 0.10666666666666667
new: 0.11594202898550723

path: .spaces[0].metrics.halstead.N2
old: 15.0
new: 23.0

path: .spaces[0].metrics.halstead.time
old: 69.49875002403854
new: 103.12795282232632

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

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

path: .spaces[0].metrics.mi.mi_visual_studio
old: 60.55024786700066
new: 62.71476025108855

path: .spaces[0].metrics.mi.mi_original
old: 103.54092385257113
new: 107.2422400293614

path: .spaces[0].metrics.mi.mi_sei
old: 102.4274885713006
new: 79.11881573157531

Code

static void serialize_gtk_printsettings_to_printdata(const gchar* key,
                                                     const gchar* value,
                                                     gpointer aData) {
  PrintData* data = (PrintData*)aData;
  CStringKeyValue pair;
  pair.key() = key;
  pair.value() = value;
  data->GTKPrintSettings().AppendElement(pair);
}

Minimal test - lines (68, 78)

path: .spaces[3].metrics.nexits.sum
old: 3.0
new: 1.0

path: .spaces[3].metrics.nexits.average
old: 3.0
new: 1.0

path: .spaces[3].metrics.cyclomatic.sum
old: 8.0
new: 1.0

path: .spaces[3].metrics.cyclomatic.average
old: 8.0
new: 1.0

path: .spaces[3].metrics.mi.mi_original
old: 80.55160392828957
new: 105.3974001211668

path: .spaces[3].metrics.mi.mi_visual_studio
old: 47.10620112765472
new: 61.63590650360632

path: .spaces[3].metrics.mi.mi_sei
old: 67.36232138185429
new: 107.1359528256673

path: .spaces[3].metrics.cognitive.sum
old: 7.0
new: 0.0

path: .spaces[3].metrics.cognitive.average
old: 7.0
new: 0.0

path: .spaces[3].metrics.halstead.N1
old: 63.0
new: 22.0

path: .spaces[3].metrics.halstead.bugs
old: 0.13869517443275384
new: 0.03497942841987602

path: .spaces[3].metrics.halstead.N2
old: 44.0
new: 16.0

path: .spaces[3].metrics.halstead.n1
old: 12.0
new: 9.0

path: .spaces[3].metrics.halstead.volume
old: 514.3869766601636
new: 164.2332676057198

path: .spaces[3].metrics.halstead.time
old: 471.5213952718166
new: 59.72118822026174

path: .spaces[3].metrics.halstead.length
old: 107.0
new: 38.0

path: .spaces[3].metrics.halstead.level
old: 0.06060606060606061
new: 0.15277777777777776

path: .spaces[3].metrics.halstead.n2
old: 16.0
new: 11.0

path: .spaces[3].metrics.halstead.vocabulary
old: 28.0
new: 20.0

path: .spaces[3].metrics.halstead.estimated_program_length
old: 107.01955000865388
new: 66.58307281799108

path: .spaces[3].metrics.halstead.purity_ratio
old: 1.0001827103612513
new: 1.752186126789239

path: .spaces[3].metrics.halstead.difficulty
old: 16.5
new: 6.545454545454546

path: .spaces[3].metrics.halstead.effort
old: 8487.385114892699
new: 1074.9813879647113

path: .spaces[3].metrics.loc.lloc
old: 15.0
new: 4.0

path: .spaces[3].metrics.loc.blank
old: 8.0
new: 0.0

path: .spaces[3].metrics.loc.ploc
old: 20.0
new: 9.0

path: .spaces[3].metrics.loc.sloc
old: 32.0
new: 11.0

path: .spaces[3].metrics.loc.cloc
old: 4.0
new: 2.0

Code

nsresult nsPrintSettingsServiceGTK::_CreatePrintSettings(
    nsIPrintSettings** _retval) {
  *_retval = nullptr;
  nsPrintSettingsGTK* printSettings =
      new nsPrintSettingsGTK();  // does not initially ref count
  NS_ENSURE_TRUE(printSettings, NS_ERROR_OUT_OF_MEMORY);

  NS_ADDREF(*_retval = printSettings);  // ref count

  return NS_OK;
}

Minimal test - lines (40, 66)

path: .spaces[2].metrics.nargs.average
old: 0.0
new: 2.0

path: .spaces[2].metrics.nargs.sum
old: 0.0
new: 2.0

path: .spaces[2].metrics.nexits.average
old: 2.0
new: 1.0

path: .spaces[2].metrics.nexits.sum
old: 2.0
new: 1.0

path: .spaces[2].metrics.cyclomatic.sum
old: 3.0
new: 2.0

path: .spaces[2].metrics.cyclomatic.average
old: 3.0
new: 2.0

path: .spaces[2].metrics.halstead.difficulty
old: 10.0
new: 14.45

path: .spaces[2].metrics.halstead.N1
old: 19.0
new: 64.0

path: .spaces[2].metrics.halstead.time
old: 74.93681875625622
new: 512.7965569041841

path: .spaces[2].metrics.halstead.bugs
old: 0.04069339433303162
new: 0.1466753553406264

path: .spaces[2].metrics.halstead.length
old: 33.0
new: 115.0

path: .spaces[2].metrics.halstead.effort
old: 1348.862737612612
new: 9230.338024275314

path: .spaces[2].metrics.halstead.level
old: 0.1
new: 0.06920415224913495

path: .spaces[2].metrics.halstead.n1
old: 10.0
new: 17.0

path: .spaces[2].metrics.halstead.estimated_program_length
old: 52.87076540327685
new: 216.69358616951132

path: .spaces[2].metrics.halstead.vocabulary
old: 17.0
new: 47.0

path: .spaces[2].metrics.halstead.volume
old: 134.88627376126118
new: 638.7777179429283

path: .spaces[2].metrics.halstead.N2
old: 14.0
new: 51.0

path: .spaces[2].metrics.halstead.n2
old: 7.0
new: 30.0

path: .spaces[2].metrics.halstead.purity_ratio
old: 1.6021444061599046
new: 1.8842920536479248

path: .spaces[2].metrics.mi.mi_visual_studio
old: 59.02721655360526
new: 48.86418057937162

path: .spaces[2].metrics.mi.mi_sei
old: 102.16074426396553
new: 73.12975212571075

path: .spaces[2].metrics.mi.mi_original
old: 100.936540306665
new: 83.55774879072547

path: .spaces[2].metrics.loc.blank
old: 3.0
new: 5.0

path: .spaces[2].metrics.loc.ploc
old: 9.0
new: 18.0

path: .spaces[2].metrics.loc.lloc
old: 4.0
new: 8.0

path: .spaces[2].metrics.loc.cloc
old: 3.0
new: 4.0

path: .spaces[2].metrics.loc.sloc
old: 15.0
new: 27.0

path: .spaces[2].metrics.cognitive.sum
old: 2.0
new: 1.0

path: .spaces[2].metrics.cognitive.average
old: 2.0
new: 1.0

Code

nsPrintSettingsServiceGTK::DeserializeToPrintSettings(
    const PrintData& data, nsIPrintSettings* settings) {
  nsCOMPtr settingsGTK(do_QueryInterface(settings));
  NS_ENSURE_STATE(settingsGTK);

  nsresult rv =
      nsPrintSettingsService::DeserializeToPrintSettings(data, settings);
  NS_ENSURE_SUCCESS(rv, rv);

  // Instead of re-using the GtkPrintSettings that nsIPrintSettings is
  // wrapping, we'll create a new one to deserialize to and replace it
  // within nsIPrintSettings.
  GtkPrintSettings* newGtkPrintSettings = gtk_print_settings_new();

  for (uint32_t i = 0; i < data.GTKPrintSettings().Length(); ++i) {
    CStringKeyValue pair = data.GTKPrintSettings()[i];
    gtk_print_settings_set(newGtkPrintSettings, pair.key().get(),
                           pair.value().get());
  }

  settingsGTK->SetGtkPrintSettings(newGtkPrintSettings);

  // nsPrintSettingsGTK is holding a reference to newGtkPrintSettings
  g_object_unref(newGtkPrintSettings);
  newGtkPrintSettings = nullptr;
  return NS_OK;
}

Minimal test - lines (22, 37)

path: .spaces[1].metrics.mi.mi_visual_studio
old: 60.41199965147084
new: 56.06778859507928

path: .spaces[1].metrics.mi.mi_original
old: 103.30451940401514
new: 95.87591849758556

path: .spaces[1].metrics.mi.mi_sei
old: 73.43788571298204
new: 62.72068002453284

path: .spaces[1].metrics.loc.ploc
old: 10.0
new: 12.0

path: .spaces[1].metrics.loc.sloc
old: 12.0
new: 16.0

path: .spaces[1].metrics.loc.blank
old: 2.0
new: 4.0

path: .spaces[1].metrics.halstead.time
old: 68.43512368601083
new: 159.0076462743608

path: .spaces[1].metrics.halstead.difficulty
old: 6.576923076923077
new: 8.973684210526315

path: .spaces[1].metrics.halstead.N2
old: 19.0
new: 31.0

path: .spaces[1].metrics.halstead.length
old: 42.0
new: 65.0

path: .spaces[1].metrics.halstead.bugs
old: 0.03830420499953338
new: 0.06719532951322882

path: .spaces[1].metrics.halstead.effort
old: 1231.8322263481948
new: 2862.137632938495

path: .spaces[1].metrics.halstead.n2
old: 13.0
new: 19.0

path: .spaces[1].metrics.halstead.volume
old: 187.29612798276648
new: 318.9478887145537

path: .spaces[1].metrics.halstead.purity_ratio
old: 1.8246438416384525
new: 1.8271441624682827

path: .spaces[1].metrics.halstead.N1
old: 23.0
new: 34.0

path: .spaces[1].metrics.halstead.estimated_program_length
old: 76.63504134881501
new: 118.76437056043838

path: .spaces[1].metrics.halstead.n1
old: 9.0
new: 11.0

path: .spaces[1].metrics.halstead.vocabulary
old: 22.0
new: 30.0

path: .spaces[1].metrics.halstead.level
old: 0.152046783625731
new: 0.11143695014662758

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

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

Code

nsPrintSettingsServiceGTK::SerializeToPrintData(nsIPrintSettings* aSettings,
                                                PrintData* data) {
  nsresult rv = nsPrintSettingsService::SerializeToPrintData(aSettings, data);
  NS_ENSURE_SUCCESS(rv, rv);

  nsCOMPtr settingsGTK(do_QueryInterface(aSettings));
  NS_ENSURE_STATE(settingsGTK);

  GtkPrintSettings* gtkPrintSettings = settingsGTK->GetGtkPrintSettings();
  NS_ENSURE_STATE(gtkPrintSettings);

  gtk_print_settings_foreach(gtkPrintSettings,
                             serialize_gtk_printsettings_to_printdata, data);

  return NS_OK;
}