Global Metrics

path: .metrics.nexits.average
old: 0.7333333333333333
new: 1.1666666666666667

path: .metrics.nexits.sum
old: 11.0
new: 7.0

path: .metrics.cognitive.average
old: 0.2
new: 1.3333333333333333

path: .metrics.cognitive.sum
old: 3.0
new: 8.0

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

path: .metrics.halstead.volume
old: 2162.196796624746
new: 1554.8211003634626

path: .metrics.halstead.estimated_program_length
old: 432.0015635957531
new: 384.29040684727767

path: .metrics.halstead.purity_ratio
old: 1.2594797772470936
new: 1.5249619319336416

path: .metrics.halstead.n1
old: 21.0
new: 19.0

path: .metrics.halstead.time
old: 2935.741340244806
new: 1734.0981664431072

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

path: .metrics.halstead.N1
old: 208.0
new: 140.0

path: .metrics.halstead.bugs
old: 0.4693955207719916
new: 0.3304528750309691

path: .metrics.halstead.effort
old: 52843.34412440651
new: 31213.76699597593

path: .metrics.halstead.N2
old: 135.0
new: 112.0

path: .metrics.halstead.level
old: 0.04091710758377425
new: 0.04981203007518797

path: .metrics.halstead.difficulty
old: 24.439655172413794
new: 20.07547169811321

path: .metrics.halstead.length
old: 343.0
new: 252.0

path: .metrics.cyclomatic.sum
old: 22.0
new: 15.0

path: .metrics.cyclomatic.average
old: 1.1578947368421053
new: 1.6666666666666667

path: .metrics.loc.lloc
old: 31.0
new: 23.0

path: .metrics.loc.sloc
old: 134.0
new: 93.0

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

path: .metrics.loc.cloc
old: 20.0
new: 14.0

path: .metrics.loc.ploc
old: 91.0
new: 62.0

path: .metrics.nom.functions
old: 15.0
new: 6.0

path: .metrics.nom.total
old: 15.0
new: 6.0

path: .metrics.nargs.average
old: 0.4
new: 1.3333333333333333

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

path: .metrics.mi.mi_visual_studio
old: 27.28936791831492
new: 32.693851583001575

path: .metrics.mi.mi_original
old: 46.664819140318514
new: 55.9064862069327

path: .metrics.mi.mi_sei
old: 22.032711232498485
new: 34.75889686567016

Spaces Data

Minimal test - lines (75, 84)

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.bugs
old: 0.006944786620971931
new: 0.04102955794835135

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

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.volume
old: 38.039100017307746
new: 166.9080620655929

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.N2
old: 4.0
new: 18.0

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.difficulty
old: 2.5
new: 8.181818181818182

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

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.time
old: 5.2832083357371875
new: 75.86730093890587

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.N1
old: 8.0
new: 20.0

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.estimated_program_length
old: 19.60964047443681
new: 71.27302875388389

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.n2
old: 4.0
new: 11.0

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.length
old: 12.0
new: 38.0

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.level
old: 0.4
new: 0.12222222222222222

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.purity_ratio
old: 1.6341367062030674
new: 1.8756060198390496

path: .spaces[0].spaces[0].spaces[4].metrics.halstead.effort
old: 95.09775004326936
new: 1365.6114169003056

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

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

path: .spaces[0].spaces[0].spaces[4].metrics.mi.mi_sei
old: 111.07306171748976
new: 101.8604258562029

path: .spaces[0].spaces[0].spaces[4].metrics.mi.mi_visual_studio
old: 75.667389205507
new: 62.355214734095135

path: .spaces[0].spaces[0].spaces[4].metrics.mi.mi_original
old: 129.391235541417
new: 106.62741719530268

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

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

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

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

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

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

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

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

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

Code

ExternalHelperAppChild::OnStopRequest(nsIRequest* request, nsresult status) {
  // mHandler can be null if we diverted the request to the parent
  if (mHandler) {
    nsresult rv = mHandler->OnStopRequest(request, status);
    SendOnStopRequest(status);
    NS_ENSURE_SUCCESS(rv, NS_ERROR_UNEXPECTED);
  }

  return NS_OK;
}

Minimal test - lines (20, 20)

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

path: .spaces[0].spaces[0].spaces[0].metrics.loc.sloc
old: 7.0
new: 1.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.N1
old: 14.0
new: 5.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.effort
old: 249.3306543742891
new: 44.91767875292167

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.n2
old: 11.0
new: 3.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.time
old: 13.85170302079384
new: 2.495426597384537

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.difficulty
old: 2.363636363636364
new: 2.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 1.7056943631485284
new: 1.5943609377704335

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 46.05374780501027
new: 12.754887502163468

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.volume
old: 105.48604608143
new: 22.458839376460833

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.bugs
old: 0.013204719996531089
new: 0.00421201861424495

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.N2
old: 13.0
new: 3.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.vocabulary
old: 15.0
new: 7.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.length
old: 27.0
new: 8.0

path: .spaces[0].spaces[0].spaces[0].metrics.halstead.level
old: 0.4230769230769231
new: 0.5

path: .spaces[0].spaces[0].spaces[0].metrics.mi.mi_original
old: 115.02164645170951
new: 154.58924178123317

path: .spaces[0].spaces[0].spaces[0].metrics.mi.mi_sei
old: 90.34212679815668
new: 147.42610035996177

path: .spaces[0].spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 67.26412073199388
new: 90.4030653691422

Code

ExternalHelperAppChild::ExternalHelperAppChild() : mStatus(NS_OK) {}

Minimal test - lines (61, 72)

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

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

path: .spaces[0].spaces[0].spaces[3].metrics.mi.mi_visual_studio
old: 75.667389205507
new: 59.36772266703963

path: .spaces[0].spaces[0].spaces[3].metrics.mi.mi_original
old: 129.391235541417
new: 101.51880576063778

path: .spaces[0].spaces[0].spaces[3].metrics.mi.mi_sei
old: 111.07306171748976
new: 70.96346535463825

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

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

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

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

path: .spaces[0].spaces[0].spaces[3].metrics.loc.sloc
old: 4.0
new: 12.0

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

path: .spaces[0].spaces[0].spaces[3].metrics.loc.lloc
old: 2.0
new: 5.0

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

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.difficulty
old: 2.5
new: 8.823529411764707

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.effort
old: 95.09775004326936
new: 2228.95598599971

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.length
old: 12.0
new: 52.0

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.time
old: 5.2832083357371875
new: 123.830888111095

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.volume
old: 38.039100017307746
new: 252.61501174663377

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.bugs
old: 0.006944786620971931
new: 0.05687827375124904

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

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.N2
old: 4.0
new: 25.0

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.level
old: 0.4
new: 0.11333333333333331

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.purity_ratio
old: 1.6341367062030674
new: 2.163584967498262

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.N1
old: 8.0
new: 27.0

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.n2
old: 4.0
new: 17.0

path: .spaces[0].spaces[0].spaces[3].metrics.halstead.estimated_program_length
old: 19.60964047443681
new: 112.50641830990963

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

Code

ExternalHelperAppChild::OnStartRequest(nsIRequest* request) {
  nsresult rv = mHandler->OnStartRequest(request);
  NS_ENSURE_SUCCESS(rv, NS_ERROR_UNEXPECTED);

  nsCString entityID;
  nsCOMPtr resumable(do_QueryInterface(request));
  if (resumable) {
    resumable->GetEntityID(entityID);
  }
  SendOnStartRequest(entityID);
  return NS_OK;
}

Minimal test - lines (16, 92)

path: .spaces[0].spaces[0].metrics.nexits.average
old: 0.9
new: 1.1666666666666667

path: .spaces[0].spaces[0].metrics.nexits.sum
old: 9.0
new: 7.0

path: .spaces[0].spaces[0].metrics.loc.lloc
old: 24.0
new: 23.0

path: .spaces[0].spaces[0].metrics.loc.blank
old: 13.0
new: 17.0

path: .spaces[0].spaces[0].metrics.loc.ploc
old: 63.0
new: 53.0

path: .spaces[0].spaces[0].metrics.loc.sloc
old: 85.0
new: 77.0

path: .spaces[0].spaces[0].metrics.loc.cloc
old: 9.0
new: 7.0

path: .spaces[0].spaces[0].metrics.cognitive.average
old: 0.2
new: 1.3333333333333333

path: .spaces[0].spaces[0].metrics.cognitive.sum
old: 2.0
new: 8.0

path: .spaces[0].spaces[0].metrics.halstead.length
old: 231.0
new: 243.0

path: .spaces[0].spaces[0].metrics.halstead.effort
old: 27915.176697706935
new: 32011.2

path: .spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 1.025860331612604
new: 1.3491523131286565

path: .spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 236.9737366025115
new: 327.8440120902635

path: .spaces[0].spaces[0].metrics.halstead.vocabulary
old: 50.0
new: 64.0

path: .spaces[0].spaces[0].metrics.halstead.time
old: 1550.8431498726077
new: 1778.4

path: .spaces[0].spaces[0].metrics.halstead.N1
old: 140.0
new: 139.0

path: .spaces[0].spaces[0].metrics.halstead.n2
old: 34.0
new: 45.0

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

path: .spaces[0].spaces[0].metrics.halstead.N2
old: 91.0
new: 104.0

path: .spaces[0].spaces[0].metrics.halstead.bugs
old: 0.30674135573987366
new: 0.33605733715384617

path: .spaces[0].spaces[0].metrics.halstead.difficulty
old: 21.41176470588235
new: 21.955555555555556

path: .spaces[0].spaces[0].metrics.halstead.level
old: 0.046703296703296704
new: 0.04554655870445344

path: .spaces[0].spaces[0].metrics.halstead.volume
old: 1303.730779837961
new: 1458.0

path: .spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 34.350600159122195
new: 34.94694936877987

path: .spaces[0].spaces[0].metrics.mi.mi_original
old: 58.73952627209896
new: 59.75928342061357

path: .spaces[0].spaces[0].metrics.mi.mi_sei
old: 34.517045158971584
new: 34.352141565286594

path: .spaces[0].spaces[0].metrics.nargs.average
old: 0.4
new: 1.3333333333333333

path: .spaces[0].spaces[0].metrics.nargs.sum
old: 4.0
new: 8.0

path: .spaces[0].spaces[0].metrics.cyclomatic.average
old: 1.181818181818182
new: 1.8571428571428572

path: .spaces[0].spaces[0].metrics.nom.functions
old: 10.0
new: 6.0

path: .spaces[0].spaces[0].metrics.nom.total
old: 10.0
new: 6.0

Code

namespace dom {

NS_IMPL_ISUPPORTS(ExternalHelperAppChild, nsIStreamListener, nsIRequestObserver)

ExternalHelperAppChild::ExternalHelperAppChild() : mStatus(NS_OK) {}

ExternalHelperAppChild::~ExternalHelperAppChild() {}

//-----------------------------------------------------------------------------
// nsIStreamListener
//-----------------------------------------------------------------------------
NS_IMETHODIMP
ExternalHelperAppChild::OnDataAvailable(nsIRequest* request,
                                        nsIInputStream* input, uint64_t offset,
                                        uint32_t count) {
  if (NS_FAILED(mStatus)) return mStatus;

  static uint32_t const kCopyChunkSize = 128 * 1024;
  uint32_t toRead = std::min(count, kCopyChunkSize);

  nsCString data;

  while (count) {
    nsresult rv = NS_ReadInputStreamToString(input, data, toRead);
    if (NS_WARN_IF(NS_FAILED(rv))) {
      return rv;
    }

    if (NS_WARN_IF(!SendOnDataAvailable(data, offset, toRead))) {
      return NS_ERROR_UNEXPECTED;
    }

    count -= toRead;
    offset += toRead;
    toRead = std::min(count, kCopyChunkSize);
  }

  return NS_OK;
}

//////////////////////////////////////////////////////////////////////////////
// nsIRequestObserver
//////////////////////////////////////////////////////////////////////////////

NS_IMETHODIMP
ExternalHelperAppChild::OnStartRequest(nsIRequest* request) {
  nsresult rv = mHandler->OnStartRequest(request);
  NS_ENSURE_SUCCESS(rv, NS_ERROR_UNEXPECTED);

  nsCString entityID;
  nsCOMPtr resumable(do_QueryInterface(request));
  if (resumable) {
    resumable->GetEntityID(entityID);
  }
  SendOnStartRequest(entityID);
  return NS_OK;
}

NS_IMETHODIMP
ExternalHelperAppChild::OnStopRequest(nsIRequest* request, nsresult status) {
  // mHandler can be null if we diverted the request to the parent
  if (mHandler) {
    nsresult rv = mHandler->OnStopRequest(request, status);
    SendOnStopRequest(status);
    NS_ENSURE_SUCCESS(rv, NS_ERROR_UNEXPECTED);
  }

  return NS_OK;
}

mozilla::ipc::IPCResult ExternalHelperAppChild::RecvCancel(
    const nsresult& aStatus) {
  mStatus = aStatus;
  return IPC_OK();
}

}  // namespace dom

Minimal test - lines (28, 54)

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

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

path: .spaces[0].spaces[0].spaces[2].metrics.mi.mi_original
old: 128.73145878874377
new: 83.30051579552372

path: .spaces[0].spaces[0].spaces[2].metrics.mi.mi_sei
old: 110.12120506831432
new: 44.985488346704415

path: .spaces[0].spaces[0].spaces[2].metrics.mi.mi_visual_studio
old: 75.28155484721857
new: 48.71375192720685

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

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

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

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

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

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

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

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

path: .spaces[0].spaces[0].spaces[2].metrics.loc.lloc
old: 2.0
new: 11.0

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

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.n2
old: 5.0
new: 23.0

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.volume
old: 43.18506523353571
new: 587.7678815056815

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.vocabulary
old: 10.0
new: 38.0

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.length
old: 13.0
new: 112.0

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.n1
old: 5.0
new: 15.0

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.N2
old: 5.0
new: 45.0

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.estimated_program_length
old: 23.21928094887362
new: 162.64528392343908

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.effort
old: 107.96266308383927
new: 8624.854782963806

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.level
old: 0.4
new: 0.06814814814814814

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.time
old: 5.997925726879959
new: 479.1585990535448

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.N1
old: 8.0
new: 67.0

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.bugs
old: 0.007557783918721112
new: 0.14018878539229496

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.difficulty
old: 2.5
new: 14.673913043478262

path: .spaces[0].spaces[0].spaces[2].metrics.halstead.purity_ratio
old: 1.78609853452874
new: 1.452190035030706

Code

ExternalHelperAppChild::OnDataAvailable(nsIRequest* request,
                                        nsIInputStream* input, uint64_t offset,
                                        uint32_t count) {
  if (NS_FAILED(mStatus)) return mStatus;

  static uint32_t const kCopyChunkSize = 128 * 1024;
  uint32_t toRead = std::min(count, kCopyChunkSize);

  nsCString data;

  while (count) {
    nsresult rv = NS_ReadInputStreamToString(input, data, toRead);
    if (NS_WARN_IF(NS_FAILED(rv))) {
      return rv;
    }

    if (NS_WARN_IF(!SendOnDataAvailable(data, offset, toRead))) {
      return NS_ERROR_UNEXPECTED;
    }

    count -= toRead;
    offset += toRead;
    toRead = std::min(count, kCopyChunkSize);
  }

  return NS_OK;
}

Minimal test - lines (22, 22)

path: .spaces[0].spaces[0].spaces[1].metrics.halstead.length
old: 76.0
new: 5.0

path: .spaces[0].spaces[0].spaces[1].metrics.halstead.vocabulary
old: 33.0
new: 5.0

path: .spaces[0].spaces[0].spaces[1].metrics.halstead.bugs
old: 0.08205855225108802
new: 0.002712967490108627

path: .spaces[0].spaces[0].spaces[1].metrics.halstead.purity_ratio
old: 1.7703194504418611
new: 1.6

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

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

path: .spaces[0].spaces[0].spaces[1].metrics.halstead.difficulty
old: 10.075
new: 2.0

path: .spaces[0].spaces[0].spaces[1].metrics.halstead.level
old: 0.09925558312655088
new: 0.5

path: .spaces[0].spaces[0].spaces[1].metrics.halstead.time
old: 214.58292095515375
new: 1.289960052715201

path: .spaces[0].spaces[0].spaces[1].metrics.halstead.n2
old: 20.0
new: 1.0

path: .spaces[0].spaces[0].spaces[1].metrics.halstead.estimated_program_length
old: 134.54427823358145
new: 8.0

path: .spaces[0].spaces[0].spaces[1].metrics.halstead.effort
old: 3862.4925771927674
new: 23.21928094887362

path: .spaces[0].spaces[0].spaces[1].metrics.halstead.volume
old: 383.37395307124245
new: 11.60964047443681

path: .spaces[0].spaces[0].spaces[1].metrics.halstead.n1
old: 13.0
new: 4.0

path: .spaces[0].spaces[0].spaces[1].metrics.mi.mi_original
old: 90.05387987251365
new: 158.02045369261705

path: .spaces[0].spaces[0].spaces[1].metrics.mi.mi_sei
old: 77.52916628189001
new: 152.37629276875444

path: .spaces[0].spaces[0].spaces[1].metrics.mi.mi_visual_studio
old: 52.66308764474482
new: 92.40962204246613

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

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

path: .spaces[0].spaces[0].spaces[1].metrics.loc.sloc
old: 21.0
new: 1.0

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

path: .spaces[0].spaces[0].spaces[1].metrics.loc.ploc
old: 17.0
new: 1.0

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

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

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

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

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

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

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

path: .spaces[0].spaces[0].spaces[1].metrics.nargs.average
old: 4.0
new: 0.0

Code

ExternalHelperAppChild::~ExternalHelperAppChild() {}

Minimal test - lines (15, 93)

path: .spaces[0].metrics.cyclomatic.sum
old: 21.0
new: 14.0

path: .spaces[0].metrics.cyclomatic.average
old: 1.1666666666666667
new: 1.75

path: .spaces[0].metrics.nexits.average
old: 0.7333333333333333
new: 1.1666666666666667

path: .spaces[0].metrics.nexits.sum
old: 11.0
new: 7.0

path: .spaces[0].metrics.mi.mi_original
old: 48.82050351237406
new: 59.05190346185776

path: .spaces[0].metrics.mi.mi_sei
old: 22.11046331703758
new: 34.58156004549321

path: .spaces[0].metrics.mi.mi_visual_studio
old: 28.55000205401992
new: 34.533276878279395

path: .spaces[0].metrics.nargs.sum
old: 6.0
new: 8.0

path: .spaces[0].metrics.nargs.average
old: 0.4
new: 1.3333333333333333

path: .spaces[0].metrics.cognitive.sum
old: 3.0
new: 8.0

path: .spaces[0].metrics.cognitive.average
old: 0.2
new: 1.3333333333333333

path: .spaces[0].metrics.loc.lloc
old: 31.0
new: 23.0

path: .spaces[0].metrics.loc.cloc
old: 14.0
new: 8.0

path: .spaces[0].metrics.loc.blank
old: 21.0
new: 16.0

path: .spaces[0].metrics.loc.ploc
old: 85.0
new: 55.0

path: .spaces[0].metrics.loc.sloc
old: 120.0
new: 79.0

path: .spaces[0].metrics.nom.functions
old: 15.0
new: 6.0

path: .spaces[0].metrics.nom.total
old: 15.0
new: 6.0

path: .spaces[0].metrics.halstead.bugs
old: 0.4682968870974488
new: 0.3359472065158145

path: .spaces[0].metrics.halstead.effort
old: 52657.93067868976
new: 31995.465519706337

path: .spaces[0].metrics.halstead.time
old: 2925.4405932605423
new: 1777.5258622059075

path: .spaces[0].metrics.halstead.purity_ratio
old: 1.2172505938344518
new: 1.3665080519757171

path: .spaces[0].metrics.halstead.vocabulary
old: 76.0
new: 65.0

path: .spaces[0].metrics.halstead.n2
old: 55.0
new: 46.0

path: .spaces[0].metrics.halstead.length
old: 337.0
new: 245.0

path: .spaces[0].metrics.halstead.volume
old: 2105.5515720304884
new: 1475.480114191971

path: .spaces[0].metrics.halstead.estimated_program_length
old: 410.21345012221025
new: 334.7944727340507

path: .spaces[0].metrics.halstead.level
old: 0.03998545983278808
new: 0.04611528822055138

path: .spaces[0].metrics.halstead.N2
old: 131.0
new: 105.0

path: .spaces[0].metrics.halstead.difficulty
old: 25.009090909090908
new: 21.684782608695652

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

path: .spaces[0].metrics.halstead.N1
old: 206.0
new: 140.0

Code

namespace mozilla {
namespace dom {

NS_IMPL_ISUPPORTS(ExternalHelperAppChild, nsIStreamListener, nsIRequestObserver)

ExternalHelperAppChild::ExternalHelperAppChild() : mStatus(NS_OK) {}

ExternalHelperAppChild::~ExternalHelperAppChild() {}

//-----------------------------------------------------------------------------
// nsIStreamListener
//-----------------------------------------------------------------------------
NS_IMETHODIMP
ExternalHelperAppChild::OnDataAvailable(nsIRequest* request,
                                        nsIInputStream* input, uint64_t offset,
                                        uint32_t count) {
  if (NS_FAILED(mStatus)) return mStatus;

  static uint32_t const kCopyChunkSize = 128 * 1024;
  uint32_t toRead = std::min(count, kCopyChunkSize);

  nsCString data;

  while (count) {
    nsresult rv = NS_ReadInputStreamToString(input, data, toRead);
    if (NS_WARN_IF(NS_FAILED(rv))) {
      return rv;
    }

    if (NS_WARN_IF(!SendOnDataAvailable(data, offset, toRead))) {
      return NS_ERROR_UNEXPECTED;
    }

    count -= toRead;
    offset += toRead;
    toRead = std::min(count, kCopyChunkSize);
  }

  return NS_OK;
}

//////////////////////////////////////////////////////////////////////////////
// nsIRequestObserver
//////////////////////////////////////////////////////////////////////////////

NS_IMETHODIMP
ExternalHelperAppChild::OnStartRequest(nsIRequest* request) {
  nsresult rv = mHandler->OnStartRequest(request);
  NS_ENSURE_SUCCESS(rv, NS_ERROR_UNEXPECTED);

  nsCString entityID;
  nsCOMPtr resumable(do_QueryInterface(request));
  if (resumable) {
    resumable->GetEntityID(entityID);
  }
  SendOnStartRequest(entityID);
  return NS_OK;
}

NS_IMETHODIMP
ExternalHelperAppChild::OnStopRequest(nsIRequest* request, nsresult status) {
  // mHandler can be null if we diverted the request to the parent
  if (mHandler) {
    nsresult rv = mHandler->OnStopRequest(request, status);
    SendOnStopRequest(status);
    NS_ENSURE_SUCCESS(rv, NS_ERROR_UNEXPECTED);
  }

  return NS_OK;
}

mozilla::ipc::IPCResult ExternalHelperAppChild::RecvCancel(
    const nsresult& aStatus) {
  mStatus = aStatus;
  return IPC_OK();
}

}  // namespace dom
}  // namespace mozilla

Minimal test - lines (86, 90)

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.estimated_program_length
old: 19.60964047443681
new: 35.161259458730164

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.difficulty
old: 2.5
new: 4.083333333333333

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.N2
old: 4.0
new: 7.0

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.volume
old: 38.039100017307746
new: 66.60791492653966

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.purity_ratio
old: 1.6341367062030674
new: 1.9534033032627869

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.N1
old: 8.0
new: 11.0

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.length
old: 12.0
new: 18.0

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.effort
old: 95.09775004326936
new: 271.98231928337026

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

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.time
old: 5.2832083357371875
new: 15.110128849076126

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

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.n1
old: 5.0
new: 7.0

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.level
old: 0.4
new: 0.2448979591836735

path: .spaces[0].spaces[0].spaces[5].metrics.halstead.bugs
old: 0.006944786620971931
new: 0.013992839750152754

path: .spaces[0].spaces[0].spaces[5].metrics.mi.mi_original
old: 129.391235541417
new: 122.8632240697927

path: .spaces[0].spaces[0].spaces[5].metrics.mi.mi_sei
old: 111.07306171748976
new: 101.65513194051115

path: .spaces[0].spaces[0].spaces[5].metrics.mi.mi_visual_studio
old: 75.667389205507
new: 71.84983863730567

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

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

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

path: .spaces[0].spaces[0].spaces[5].metrics.loc.sloc
old: 4.0
new: 5.0

Code

mozilla::ipc::IPCResult ExternalHelperAppChild::RecvCancel(
    const nsresult& aStatus) {
  mStatus = aStatus;
  return IPC_OK();
}