Global Metrics

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

path: .metrics.nom.total
old: 0.0
new: 5.0

path: .metrics.nom.closures
old: 0.0
new: 1.0

path: .metrics.nargs.average
old: null
new: 1.4

path: .metrics.nargs.sum
old: 0.0
new: 7.0

path: .metrics.halstead.volume
old: 532.1928094887363
new: 9829.459846870524

path: .metrics.halstead.purity_ratio
old: 1.8848351160683847
new: 1.2879982599305466

path: .metrics.halstead.n2
old: 34.0
new: 194.0

path: .metrics.halstead.difficulty
old: 4.5
new: 40.51546391752577

path: .metrics.halstead.level
old: 0.2222222222222222
new: 0.024681933842239188

path: .metrics.halstead.N1
old: 49.0
new: 735.0

path: .metrics.halstead.estimated_program_length
old: 188.48351160683848
new: 1621.5898092525583

path: .metrics.halstead.length
old: 100.0
new: 1259.0

path: .metrics.halstead.bugs
old: 0.05966684708096519
new: 1.8043151317221409

path: .metrics.halstead.N2
old: 51.0
new: 524.0

path: .metrics.halstead.vocabulary
old: 40.0
new: 224.0

path: .metrics.halstead.effort
old: 2394.867642699314
new: 398245.12575465103

path: .metrics.halstead.n1
old: 6.0
new: 30.0

path: .metrics.halstead.time
old: 133.04820237218408
new: 22124.729208591725

path: .metrics.cyclomatic.average
old: 1.0
new: 5.6

path: .metrics.cyclomatic.sum
old: 11.0
new: 28.0

path: .metrics.loc.sloc
old: 105.0
new: 371.0

path: .metrics.loc.ploc
old: 37.0
new: 224.0

path: .metrics.loc.lloc
old: 0.0
new: 111.0

path: .metrics.loc.cloc
old: 51.0
new: 89.0

path: .metrics.loc.blank
old: 17.0
new: 58.0

path: .metrics.cognitive.average
old: null
new: 5.2

path: .metrics.cognitive.sum
old: 0.0
new: 26.0

path: .metrics.mi.mi_original
old: 60.43541192027658
new: 20.913202422435138

path: .metrics.mi.mi_visual_studio
old: 35.34234615220853
new: 12.229942937096569

path: .metrics.mi.mi_sei
old: 56.69944115201611
new: -8.276830703997035

path: .metrics.nexits.sum
old: 0.0
new: 15.0

path: .metrics.nexits.average
old: null
new: 3.0

Spaces Data

Minimal test - lines (71, 138)

path: .spaces[0].metrics.nom.functions
old: 0.0
new: 1.0

path: .spaces[0].metrics.nom.total
old: 0.0
new: 1.0

path: .spaces[0].metrics.cognitive.average
old: null
new: 7.0

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

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

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

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

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

path: .spaces[0].metrics.mi.mi_original
old: 119.11032331167443
new: 61.87449211692096

path: .spaces[0].metrics.mi.mi_sei
old: 140.6974428341897
new: 42.36741410632939

path: .spaces[0].metrics.mi.mi_visual_studio
old: 69.65515983138857
new: 36.18391351866723

path: .spaces[0].metrics.nexits.average
old: null
new: 8.0

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

path: .spaces[0].metrics.loc.cloc
old: 4.0
new: 10.0

path: .spaces[0].metrics.loc.ploc
old: 4.0
new: 48.0

path: .spaces[0].metrics.loc.sloc
old: 8.0
new: 68.0

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

path: .spaces[0].metrics.loc.lloc
old: 0.0
new: 22.0

path: .spaces[0].metrics.halstead.bugs
old: 0.004374941425395412
new: 0.383170870050514

path: .spaces[0].metrics.halstead.time
old: 2.6416041678685938
new: 2165.2004299520045

path: .spaces[0].metrics.halstead.level
old: 0.6666666666666666
new: 0.04576659038901602

path: .spaces[0].metrics.halstead.N2
old: 6.0
new: 115.0

path: .spaces[0].metrics.halstead.purity_ratio
old: 2.0264662506490403
new: 1.242819973438919

path: .spaces[0].metrics.halstead.vocabulary
old: 9.0
new: 69.0

path: .spaces[0].metrics.halstead.difficulty
old: 1.5
new: 21.85

path: .spaces[0].metrics.halstead.length
old: 10.0
new: 292.0

path: .spaces[0].metrics.halstead.N1
old: 4.0
new: 177.0

path: .spaces[0].metrics.halstead.volume
old: 31.69925001442312
new: 1783.6891413792257

path: .spaces[0].metrics.halstead.estimated_program_length
old: 20.264662506490403
new: 362.9034322441643

path: .spaces[0].metrics.halstead.n1
old: 3.0
new: 19.0

path: .spaces[0].metrics.halstead.effort
old: 47.548875021634686
new: 38973.60773913608

path: .spaces[0].metrics.halstead.n2
old: 6.0
new: 50.0

Code

static nsReturnRef CreateGlobalDevModeAndInit(
    const nsString& aPrintName, nsIPrintSettings* aPS) {
  nsHPRINTER hPrinter = nullptr;
  // const cast kludge for silly Win32 api's
  LPWSTR printName =
      const_cast(static_cast(aPrintName.get()));
  BOOL status = ::OpenPrinterW(printName, &hPrinter, nullptr);
  if (!status) {
    return nsReturnRef();
  }

  // Make sure hPrinter is closed on all paths
  nsAutoPrinter autoPrinter(hPrinter);

  // Get the buffer size
  LONG needed = ::DocumentPropertiesW(gParentWnd, hPrinter, printName, nullptr,
                                      nullptr, 0);
  if (needed < 0) {
    return nsReturnRef();
  }

  // Some drivers do not return the correct size for their DEVMODE, so we
  // over-allocate to try and compensate.
  // (See https://bugzilla.mozilla.org/show_bug.cgi?id=1664530#c5)
  needed *= 2;
  nsAutoDevMode newDevMode(
      (LPDEVMODEW)::HeapAlloc(::GetProcessHeap(), HEAP_ZERO_MEMORY, needed));
  if (!newDevMode) {
    return nsReturnRef();
  }

  nsHGLOBAL hDevMode = ::GlobalAlloc(GHND, needed);
  nsAutoGlobalMem globalDevMode(hDevMode);
  if (!hDevMode) {
    return nsReturnRef();
  }

  LONG ret = ::DocumentPropertiesW(gParentWnd, hPrinter, printName, newDevMode,
                                   nullptr, DM_OUT_BUFFER);
  if (ret != IDOK) {
    return nsReturnRef();
  }

  // Lock memory and copy contents from DEVMODE (current printer)
  // to Global Memory DEVMODE
  LPDEVMODEW devMode = (DEVMODEW*)::GlobalLock(hDevMode);
  if (!devMode) {
    return nsReturnRef();
  }

  memcpy(devMode, newDevMode.get(), needed);
  // Initialize values from the PrintSettings
  nsCOMPtr psWin = do_QueryInterface(aPS);
  MOZ_ASSERT(psWin);
  psWin->CopyToNative(devMode);

  // Sets back the changes we made to the DevMode into the Printer Driver
  ret = ::DocumentPropertiesW(gParentWnd, hPrinter, printName, devMode, devMode,
                              DM_IN_BUFFER | DM_OUT_BUFFER);
  if (ret != IDOK) {
    ::GlobalUnlock(hDevMode);
    return nsReturnRef();
  }

  ::GlobalUnlock(hDevMode);

  return globalDevMode.out();
}

Minimal test - lines (142, 149)

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

path: .spaces[1].metrics.loc.cloc
old: 7.0
new: 0.0

path: .spaces[1].metrics.loc.sloc
old: 17.0
new: 8.0

path: .spaces[1].metrics.loc.lloc
old: 0.0
new: 3.0

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

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

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

path: .spaces[1].metrics.nargs.average
old: null
new: 1.0

path: .spaces[1].metrics.nom.functions
old: 0.0
new: 1.0

path: .spaces[1].metrics.nom.total
old: 0.0
new: 1.0

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

path: .spaces[1].metrics.cognitive.average
old: null
new: 1.0

path: .spaces[1].metrics.halstead.purity_ratio
old: 1.5134151316928142
new: 2.2272821485588716

path: .spaces[1].metrics.halstead.length
old: 19.0
new: 32.0

path: .spaces[1].metrics.halstead.level
old: 0.6666666666666666
new: 0.12987012987012986

path: .spaces[1].metrics.halstead.volume
old: 65.72920075410865
new: 140.55415752892034

path: .spaces[1].metrics.halstead.effort
old: 98.59380113116296
new: 1082.2670129726866

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

path: .spaces[1].metrics.halstead.n2
old: 8.0
new: 10.0

path: .spaces[1].metrics.halstead.estimated_program_length
old: 28.75488750216347
new: 71.27302875388389

path: .spaces[1].metrics.halstead.N1
old: 11.0
new: 18.0

path: .spaces[1].metrics.halstead.bugs
old: 0.00711396655236694
new: 0.03513729781588999

path: .spaces[1].metrics.halstead.vocabulary
old: 11.0
new: 21.0

path: .spaces[1].metrics.halstead.difficulty
old: 1.5
new: 7.7

path: .spaces[1].metrics.halstead.N2
old: 8.0
new: 14.0

path: .spaces[1].metrics.halstead.time
old: 5.47743339617572
new: 60.12594516514926

path: .spaces[1].metrics.mi.mi_visual_studio
old: 60.162057752278336
new: 64.99179184948042

path: .spaces[1].metrics.mi.mi_original
old: 102.87711875639596
new: 111.13596406261152

path: .spaces[1].metrics.mi.mi_sei
old: 114.83653211286286
new: 84.83809194433985

Code

static void GetDefaultPrinterNameFromGlobalPrinters(nsAString& aPrinterName) {
  aPrinterName.Truncate();
  nsCOMPtr printerList =
      do_GetService("@mozilla.org/gfx/printerlist;1");
  if (printerList) {
    printerList->GetSystemDefaultPrinterName(aPrinterName);
  }
}

Minimal test - lines (153, 359)

path: .spaces[2].metrics.loc.cloc
old: 0.0
new: 37.0

path: .spaces[2].metrics.loc.lloc
old: 0.0
new: 83.0

path: .spaces[2].metrics.loc.ploc
old: 1.0
new: 139.0

path: .spaces[2].metrics.loc.sloc
old: 1.0
new: 207.0

path: .spaces[2].metrics.loc.blank
old: 0.0
new: 31.0

path: .spaces[2].metrics.nom.total
old: 0.0
new: 2.0

path: .spaces[2].metrics.nom.functions
old: 0.0
new: 1.0

path: .spaces[2].metrics.nom.closures
old: 0.0
new: 1.0

path: .spaces[2].metrics.cognitive.average
old: null
new: 8.5

path: .spaces[2].metrics.cognitive.sum
old: 0.0
new: 17.0

path: .spaces[2].metrics.nargs.average
old: null
new: 1.0

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

path: .spaces[2].metrics.halstead.level
old: null
new: 0.02720831365139348

path: .spaces[2].metrics.halstead.estimated_program_length
old: null
new: 1173.3506490663924

path: .spaces[2].metrics.halstead.vocabulary
old: 1.0
new: 173.0

path: .spaces[2].metrics.halstead.time
old: 0.0
new: 13434.71310064395

path: .spaces[2].metrics.halstead.N2
old: 1.0
new: 365.0

path: .spaces[2].metrics.halstead.n2
old: 1.0
new: 144.0

path: .spaces[2].metrics.halstead.volume
old: 0.0
new: 6579.645981458501

path: .spaces[2].metrics.halstead.length
old: 1.0
new: 885.0

path: .spaces[2].metrics.halstead.effort
old: 0.0
new: 241824.8358115911

path: .spaces[2].metrics.halstead.difficulty
old: 0.0
new: 36.75347222222222

path: .spaces[2].metrics.halstead.n1
old: 0.0
new: 29.0

path: .spaces[2].metrics.halstead.bugs
old: 0.0
new: 1.2938363439372926

path: .spaces[2].metrics.halstead.N1
old: 0.0
new: 520.0

path: .spaces[2].metrics.halstead.purity_ratio
old: null
new: 1.3258199424479011

path: .spaces[2].metrics.mi.mi_visual_studio
old: null
new: 20.72685801266581

path: .spaces[2].metrics.mi.mi_original
old: null
new: 35.442927201658534

path: .spaces[2].metrics.mi.mi_sei
old: null
new: 7.416547926241126

path: .spaces[2].metrics.cyclomatic.sum
old: 1.0
new: 15.0

path: .spaces[2].metrics.cyclomatic.average
old: 1.0
new: 15.0

path: .spaces[2].metrics.nexits.average
old: null
new: 3.0

path: .spaces[2].metrics.nexits.sum
old: 0.0
new: 6.0

Code

static nsresult ShowNativePrintDialog(HWND aHWnd,
                                      nsIPrintSettings* aPrintSettings) {
  // NS_ENSURE_ARG_POINTER(aHWnd);
  NS_ENSURE_ARG_POINTER(aPrintSettings);

  // Get the Print Name to be used
  nsString printerName;
  aPrintSettings->GetPrinterName(printerName);

  // If there is no name then use the default printer
  if (printerName.IsEmpty()) {
    GetDefaultPrinterNameFromGlobalPrinters(printerName);
  } else {
    HANDLE hPrinter = nullptr;
    if (!::OpenPrinterW(const_cast(
                            static_cast(printerName.get())),
                        &hPrinter, nullptr)) {
      // If the last used printer is not found, we should use default printer.
      GetDefaultPrinterNameFromGlobalPrinters(printerName);
    } else {
      ::ClosePrinter(hPrinter);
    }
  }

  // Now create a DEVNAMES struct so the the dialog is initialized correctly.

  uint32_t len = printerName.Length();
  nsHGLOBAL hDevNames =
      ::GlobalAlloc(GHND, sizeof(wchar_t) * (len + 1) + sizeof(DEVNAMES));
  nsAutoGlobalMem autoDevNames(hDevNames);
  if (!hDevNames) {
    return NS_ERROR_OUT_OF_MEMORY;
  }

  DEVNAMES* pDevNames = (DEVNAMES*)::GlobalLock(hDevNames);
  if (!pDevNames) {
    return NS_ERROR_FAILURE;
  }
  pDevNames->wDriverOffset = sizeof(DEVNAMES) / sizeof(wchar_t);
  pDevNames->wDeviceOffset = sizeof(DEVNAMES) / sizeof(wchar_t);
  pDevNames->wOutputOffset = sizeof(DEVNAMES) / sizeof(wchar_t) + len;
  pDevNames->wDefault = 0;

  memcpy(pDevNames + 1, printerName.get(), (len + 1) * sizeof(wchar_t));
  ::GlobalUnlock(hDevNames);

  // Create a Moveable Memory Object that holds a new DevMode
  // from the Printer Name
  // The PRINTDLG.hDevMode requires that it be a moveable memory object
  // NOTE: autoDevMode is automatically freed when any error occurred
  nsAutoGlobalMem autoDevMode(
      CreateGlobalDevModeAndInit(printerName, aPrintSettings));

  // Prepare to Display the Print Dialog
  // https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ms646942(v=vs.85)
  // https://docs.microsoft.com/en-us/windows/win32/api/commdlg/ns-commdlg-printdlgexw
  PRINTDLGEXW prntdlg;
  memset(&prntdlg, 0, sizeof(prntdlg));

  prntdlg.lStructSize = sizeof(prntdlg);
  prntdlg.hwndOwner = aHWnd;
  prntdlg.hDevMode = autoDevMode.get();
  prntdlg.hDevNames = hDevNames;
  prntdlg.hDC = nullptr;
  prntdlg.Flags = PD_ALLPAGES | PD_RETURNIC | PD_USEDEVMODECOPIESANDCOLLATE |
                  PD_COLLATE | PD_NOCURRENTPAGE;

  // If there is a current selection then enable the "Selection" radio button
  if (!aPrintSettings->GetIsPrintSelectionRBEnabled()) {
    prntdlg.Flags |= PD_NOSELECTION;
  }

  // 10 seems like a reasonable max number of ranges to support by default if
  // the user doesn't choose a greater thing in the UI.
  constexpr size_t kMinSupportedRanges = 10;

  AutoTArray winPageRanges;
  // Set up the page ranges.
  {
    AutoTArray pageRanges;
    aPrintSettings->GetPageRanges(pageRanges);
    // If there is a specified page range then enable the "Custom" radio button
    if (!pageRanges.IsEmpty()) {
      prntdlg.Flags |= PD_PAGENUMS;
    }

    const size_t specifiedRanges = pageRanges.Length() / 2;
    const size_t maxRanges = std::max(kMinSupportedRanges, specifiedRanges);

    prntdlg.nMaxPageRanges = maxRanges;
    prntdlg.nPageRanges = specifiedRanges;

    winPageRanges.SetCapacity(maxRanges);
    for (size_t i = 0; i < pageRanges.Length(); i += 2) {
      PRINTPAGERANGE* range = winPageRanges.AppendElement();
      range->nFromPage = pageRanges[i];
      range->nToPage = pageRanges[i + 1];
    }
    prntdlg.lpPageRanges = winPageRanges.Elements();

    prntdlg.nMinPage = 1;
    // TODO(emilio): Could probably get the right page number here from the
    // new print UI.
    prntdlg.nMaxPage = 0xFFFF;
  }

  // NOTE(emilio): This can always be 1 because we use the DEVMODE copies
  // feature (see PD_USEDEVMODECOPIESANDCOLLATE).
  prntdlg.nCopies = 1;

  prntdlg.hInstance = nullptr;
  prntdlg.lpPrintTemplateName = nullptr;

  prntdlg.lpCallback = nullptr;
  prntdlg.nPropertyPages = 0;
  prntdlg.lphPropertyPages = nullptr;

  prntdlg.nStartPage = START_PAGE_GENERAL;
  prntdlg.dwResultAction = 0;

  HRESULT result;
  {
    mozilla::widget::WinUtils::AutoSystemDpiAware dpiAwareness;
    mozilla::BackgroundHangMonitor().NotifyWait();
    result = ::PrintDlgExW(&prntdlg);
  }

  auto cancelOnExit = mozilla::MakeScopeExit([&] {
    ::SetFocus(aHWnd);
    aPrintSettings->SetIsCancelled(true);
  });

  if (NS_WARN_IF(!SUCCEEDED(result))) {
#ifdef DEBUG
    printf_stderr("PrintDlgExW failed with %x\n", result);
#endif
    return NS_ERROR_FAILURE;
  }
  if (NS_WARN_IF(prntdlg.dwResultAction != PD_RESULT_PRINT)) {
    return NS_ERROR_ABORT;
  }
  // check to make sure we don't have any nullptr pointers
  NS_ENSURE_TRUE(prntdlg.hDevMode, NS_ERROR_ABORT);
  NS_ENSURE_TRUE(prntdlg.hDevNames, NS_ERROR_ABORT);
  // Lock the deviceNames and check for nullptr
  DEVNAMES* devnames = (DEVNAMES*)::GlobalLock(prntdlg.hDevNames);
  NS_ENSURE_TRUE(devnames, NS_ERROR_ABORT);

  char16_t* device = &(((char16_t*)devnames)[devnames->wDeviceOffset]);
  char16_t* driver = &(((char16_t*)devnames)[devnames->wDriverOffset]);

  // Check to see if the "Print To File" control is checked
  // then take the name from devNames and set it in the PrintSettings
  //
  // NOTE:
  // As per Microsoft SDK documentation the returned value offset from
  // devnames->wOutputOffset is either "FILE:" or nullptr
  // if the "Print To File" checkbox is checked it MUST be "FILE:"
  // We assert as an extra safety check.
  if (prntdlg.Flags & PD_PRINTTOFILE) {
    char16ptr_t fileName = &(((wchar_t*)devnames)[devnames->wOutputOffset]);
    NS_ASSERTION(wcscmp(fileName, L"FILE:") == 0, "FileName must be `FILE:`");
    aPrintSettings->SetToFileName(nsDependentString(fileName));
    aPrintSettings->SetPrintToFile(true);
  } else {
    // clear "print to file" info
    aPrintSettings->SetPrintToFile(false);
    aPrintSettings->SetToFileName(u""_ns);
  }

  nsCOMPtr psWin(do_QueryInterface(aPrintSettings));
  MOZ_RELEASE_ASSERT(psWin);

  // Setup local Data members
  psWin->SetDeviceName(nsDependentString(device));
  psWin->SetDriverName(nsDependentString(driver));

  // Fill the print options with the info from the dialog
  aPrintSettings->SetPrinterName(nsDependentString(device));
  aPrintSettings->SetPrintSelectionOnly(prntdlg.Flags & PD_SELECTION);

  AutoTArray pageRanges;
  if (prntdlg.Flags & PD_PAGENUMS) {
    pageRanges.SetCapacity(prntdlg.nPageRanges * 2);
    for (const auto& range : Span(prntdlg.lpPageRanges, prntdlg.nPageRanges)) {
      pageRanges.AppendElement(range.nFromPage);
      pageRanges.AppendElement(range.nToPage);
    }
  }
  aPrintSettings->SetPageRanges(pageRanges);

  // Unlock DeviceNames
  ::GlobalUnlock(prntdlg.hDevNames);

  // Transfer the settings from the native data to the PrintSettings
  LPDEVMODEW devMode = (LPDEVMODEW)::GlobalLock(prntdlg.hDevMode);
  if (!devMode || !prntdlg.hDC) {
    return NS_ERROR_FAILURE;
  }
  psWin->SetDevMode(devMode);  // copies DevMode
  psWin->CopyFromNative(prntdlg.hDC, devMode);
  ::GlobalUnlock(prntdlg.hDevMode);
  ::DeleteDC(prntdlg.hDC);

  cancelOnExit.release();
  return NS_OK;
}

Minimal test - lines (364, 371)

path: .spaces[3].metrics.mi.mi_sei
old: null
new: 85.46606771783632

path: .spaces[3].metrics.mi.mi_original
old: null
new: 111.57124369947051

path: .spaces[3].metrics.mi.mi_visual_studio
old: null
new: 65.24634134471961

path: .spaces[3].metrics.nom.total
old: 0.0
new: 1.0

path: .spaces[3].metrics.nom.functions
old: 0.0
new: 1.0

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

path: .spaces[3].metrics.nargs.average
old: null
new: 2.0

path: .spaces[3].metrics.halstead.effort
old: 0.0
new: 1131.0921566412271

path: .spaces[3].metrics.halstead.n2
old: 1.0
new: 8.0

path: .spaces[3].metrics.halstead.estimated_program_length
old: null
new: 57.219280948873624

path: .spaces[3].metrics.halstead.vocabulary
old: 1.0
new: 18.0

path: .spaces[3].metrics.halstead.N1
old: 0.0
new: 17.0

path: .spaces[3].metrics.halstead.difficulty
old: 0.0
new: 8.75

path: .spaces[3].metrics.halstead.length
old: 1.0
new: 31.0

path: .spaces[3].metrics.halstead.n1
old: 0.0
new: 10.0

path: .spaces[3].metrics.halstead.level
old: null
new: 0.11428571428571428

path: .spaces[3].metrics.halstead.purity_ratio
old: null
new: 1.8457832564152783

path: .spaces[3].metrics.halstead.time
old: 0.0
new: 62.83845314673484

path: .spaces[3].metrics.halstead.volume
old: 0.0
new: 129.26767504471167

path: .spaces[3].metrics.halstead.bugs
old: 0.0
new: 0.03618629109801219

path: .spaces[3].metrics.halstead.N2
old: 1.0
new: 14.0

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

path: .spaces[3].metrics.cognitive.average
old: null
new: 1.0

path: .spaces[3].metrics.loc.sloc
old: 1.0
new: 8.0

path: .spaces[3].metrics.loc.lloc
old: 0.0
new: 3.0

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

path: .spaces[3].metrics.loc.ploc
old: 1.0
new: 7.0

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

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

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

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

Code

nsresult NativeShowPrintDialog(HWND aHWnd, nsIPrintSettings* aPrintSettings) {
  nsresult rv = ShowNativePrintDialog(aHWnd, aPrintSettings);
  if (aHWnd) {
    ::DestroyWindow(aHWnd);
  }

  return rv;
}