# Global Metrics

path: .metrics.cyclomatic.sum
old: 26.0
new: 9.0
path: .metrics.cyclomatic.average
old: 8.666666666666666
new: 2.25
path: .metrics.mi.mi_visual_studio
old: 0.0
new: 36.23038516108985
path: .metrics.mi.mi_original
old: -15.00091710047286
new: 61.95395862546364
path: .metrics.mi.mi_sei
old: -80.07494493960081
new: 39.1292642725298
path: .metrics.nexits.average
old: 8.0
new: 2.6666666666666665
path: .metrics.nexits.sum
old: 16.0
new: 8.0
path: .metrics.halstead.purity_ratio
old: 0.1778431224818435
new: 1.2629449206813388
path: .metrics.halstead.difficulty
old: 398.44306418219463
new: 19.047619047619047
path: .metrics.halstead.volume
old: 225843.0524446841
new: 1347.3356288793416
path: .metrics.halstead.length
old: 25078.0
new: 230.0
path: .metrics.halstead.estimated_program_length
old: 4459.949825599671
new: 290.47733175670794
path: .metrics.halstead.level
old: 0.0025097688726305285
new: 0.0525
path: .metrics.halstead.time
old: 4999199.880017778
new: 1425.7519882321076
path: .metrics.halstead.N1
old: 12662.0
new: 130.0
path: .metrics.halstead.N2
old: 12416.0
new: 100.0
path: .metrics.halstead.effort
old: 89985597.84032
new: 25663.535788177935
path: .metrics.halstead.bugs
old: 66.9361531286615
new: 0.2900167441119745
path: .metrics.halstead.n1
old: 31.0
new: 16.0
path: .metrics.halstead.n2
old: 483.0
new: 42.0
path: .metrics.halstead.vocabulary
old: 514.0
new: 58.0
path: .metrics.cognitive.average
old: 15.0
new: 1.6666666666666667
path: .metrics.cognitive.sum
old: 30.0
new: 5.0
path: .metrics.nargs.sum
old: 3.0
new: 5.0
path: .metrics.nargs.average
old: 1.5
new: 1.6666666666666667
path: .metrics.nom.total
old: 2.0
new: 3.0
path: .metrics.nom.functions
old: 2.0
new: 3.0
path: .metrics.loc.cloc
old: 47.0
new: 8.0
path: .metrics.loc.lloc
old: 53.0
new: 23.0
path: .metrics.loc.sloc
old: 1281.0
new: 73.0
path: .metrics.loc.ploc
old: 1205.0
new: 50.0
path: .metrics.loc.blank
old: 29.0
new: 15.0

# Spaces Data

## Minimal test - lines (16, 31)

path: .spaces[0].metrics.cognitive.average
old: 23.0
new: 2.0
path: .spaces[0].metrics.cognitive.sum
old: 23.0
new: 2.0
path: .spaces[0].metrics.nexits.average
old: 12.0
new: 3.0
path: .spaces[0].metrics.nexits.sum
old: 12.0
new: 3.0
path: .spaces[0].metrics.loc.lloc
old: 37.0
new: 7.0
path: .spaces[0].metrics.loc.cloc
old: 2.0
new: 0.0
path: .spaces[0].metrics.loc.ploc
old: 64.0
new: 13.0
path: .spaces[0].metrics.loc.sloc
old: 66.0
new: 16.0
path: .spaces[0].metrics.loc.blank
old: 0.0
new: 3.0
path: .spaces[0].metrics.cyclomatic.average
old: 18.0
new: 3.0
path: .spaces[0].metrics.cyclomatic.sum
old: 18.0
new: 3.0
path: .spaces[0].metrics.halstead.volume
old: 1636.1247989274789
new: 373.28516483252554
path: .spaces[0].metrics.halstead.time
old: 1827.2390916796912
new: 236.85052856332763
path: .spaces[0].metrics.halstead.difficulty
old: 20.102564102564106
new: 11.421052631578949
path: .spaces[0].metrics.halstead.effort
old: 32890.30365023444
new: 4263.309514139897
path: .spaces[0].metrics.halstead.length
old: 283.0
new: 74.0
path: .spaces[0].metrics.halstead.estimated_program_length
old: 270.13068653562766
new: 134.01359166423458
path: .spaces[0].metrics.halstead.bugs
old: 0.3421821367702453
new: 0.087641537441563
path: .spaces[0].metrics.halstead.n1
old: 16.0
new: 14.0
path: .spaces[0].metrics.halstead.N2
old: 98.0
new: 31.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 0.9545253941188256
new: 1.810994481949116
path: .spaces[0].metrics.halstead.N1
old: 185.0
new: 43.0
path: .spaces[0].metrics.halstead.level
old: 0.04974489795918367
new: 0.08755760368663595
path: .spaces[0].metrics.halstead.vocabulary
old: 55.0
new: 33.0
path: .spaces[0].metrics.halstead.n2
old: 39.0
new: 19.0
path: .spaces[0].metrics.mi.mi_visual_studio
old: 35.38429651090475
new: 55.32039821530754
path: .spaces[0].metrics.mi.mi_original
old: 60.507147033647115
new: 94.5978809481759
path: .spaces[0].metrics.mi.mi_sei
old: 26.74641460726689
new: 61.08050130873856
path: .spaces[0].metrics.nargs.sum
old: 0.0
new: 2.0
path: .spaces[0].metrics.nargs.average
old: 0.0
new: 2.0

### Code

    nsPrintSettingsServiceX::SerializeToPrintData(nsIPrintSettings* aSettings, PrintData* data) {
      nsresult rv = nsPrintSettingsService::SerializeToPrintData(aSettings, data);
      if (NS_WARN_IF(NS_FAILED(rv))) {
        return rv;
      }

      RefPtr settingsX(do_QueryObject(aSettings));
      if (NS_WARN_IF(!settingsX)) {
        return NS_ERROR_FAILURE;
      }

      settingsX->GetDisposition(data->disposition());
      settingsX->GetDestination(&data->destination());

      return NS_OK;
    }

## Minimal test - lines (34, 50)

path: .spaces[1].metrics.mi.mi_original
old: 73.11225468803949
new: 93.64230264890097
path: .spaces[1].metrics.mi.mi_sei
old: 62.09785391932
new: 59.70189323519352
path: .spaces[1].metrics.mi.mi_visual_studio
old: 42.75570449592952
new: 54.76158049643332
path: .spaces[1].metrics.cyclomatic.average
old: 7.0
new: 3.0
path: .spaces[1].metrics.cyclomatic.sum
old: 7.0
new: 3.0
path: .spaces[1].metrics.loc.blank
old: 4.0
new: 3.0
path: .spaces[1].metrics.loc.lloc
old: 16.0
new: 7.0
path: .spaces[1].metrics.loc.cloc
old: 8.0
new: 0.0
path: .spaces[1].metrics.loc.ploc
old: 29.0
new: 14.0
path: .spaces[1].metrics.loc.sloc
old: 41.0
new: 17.0
path: .spaces[1].metrics.nargs.average
old: 3.0
new: 2.0
path: .spaces[1].metrics.nargs.sum
old: 3.0
new: 2.0
path: .spaces[1].metrics.cognitive.average
old: 7.0
new: 2.0
path: .spaces[1].metrics.cognitive.sum
old: 7.0
new: 2.0
path: .spaces[1].metrics.halstead.n1
old: 24.0
new: 15.0
path: .spaces[1].metrics.halstead.time
old: 2132.841112784564
new: 252.4765002138052
path: .spaces[1].metrics.halstead.vocabulary
old: 49.0
new: 34.0
path: .spaces[1].metrics.halstead.N1
old: 108.0
new: 42.0
path: .spaces[1].metrics.halstead.difficulty
old: 36.96
new: 12.236842105263158
path: .spaces[1].metrics.halstead.estimated_program_length
old: 226.13550476167583
new: 139.3139816895559
path: .spaces[1].metrics.halstead.length
old: 185.0
new: 73.0
path: .spaces[1].metrics.halstead.n2
old: 25.0
new: 19.0
path: .spaces[1].metrics.halstead.effort
old: 38391.14003012215
new: 4544.577003848493
path: .spaces[1].metrics.halstead.N2
old: 77.0
new: 31.0
path: .spaces[1].metrics.halstead.level
old: 0.027056277056277056
new: 0.08172043010752689
path: .spaces[1].metrics.halstead.purity_ratio
old: 1.2223540797928425
new: 1.9084107080761084
path: .spaces[1].metrics.halstead.volume
old: 1038.7213211613137
new: 371.3847874112748
path: .spaces[1].metrics.halstead.bugs
old: 0.3793435910353808
new: 0.0914550566275064
path: .spaces[1].metrics.nexits.sum
old: 4.0
new: 3.0
path: .spaces[1].metrics.nexits.average
old: 4.0
new: 3.0

### Code

    nsPrintSettingsServiceX::DeserializeToPrintSettings(const PrintData& data,
                                                        nsIPrintSettings* settings) {
      nsresult rv = nsPrintSettingsService::DeserializeToPrintSettings(data, settings);
      if (NS_WARN_IF(NS_FAILED(rv))) {
        return rv;
      }

      RefPtr settingsX(do_QueryObject(settings));
      if (NS_WARN_IF(!settingsX)) {
        return NS_ERROR_FAILURE;
      }

      settingsX->SetDisposition(data.disposition());
      settingsX->SetDestination(data.destination());

      return NS_OK;
    }