Global Metrics

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

path: .metrics.loc.sloc
old: 109.0
new: 204.0

path: .metrics.loc.lloc
old: 14.0
new: 60.0

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

path: .metrics.loc.cloc
old: 41.0
new: 6.0

path: .metrics.nexits.average
old: 0.0
new: 0.8

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

path: .metrics.mi.mi_original
old: 57.95052979084856
new: 36.4689362080166

path: .metrics.mi.mi_sei
old: 50.10602442754528
new: -7.8205925595115

path: .metrics.mi.mi_visual_studio
old: 33.889198708098576
new: 21.32686327954187

path: .metrics.nargs.sum
old: 10.0
new: 3.0

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

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

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

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

path: .metrics.cognitive.average
old: 0.0
new: 4.4

path: .metrics.halstead.purity_ratio
old: 1.0357128906429072
new: 1.1241068641819043

path: .metrics.halstead.bugs
old: 0.13069219119569142
new: 1.1291399877703638

path: .metrics.halstead.estimated_program_length
old: 132.57125000229212
new: 709.3114312987818

path: .metrics.halstead.vocabulary
old: 32.0
new: 117.0

path: .metrics.halstead.volume
old: 640.0
new: 4335.200138057128

path: .metrics.halstead.n1
old: 9.0
new: 29.0

path: .metrics.halstead.difficulty
old: 12.130434782608695
new: 45.47727272727273

path: .metrics.halstead.level
old: 0.08243727598566308
new: 0.021989005497251374

path: .metrics.halstead.length
old: 128.0
new: 631.0

path: .metrics.halstead.time
old: 431.30434782608694
new: 10952.94883365191

path: .metrics.halstead.N1
old: 66.0
new: 355.0

path: .metrics.halstead.n2
old: 23.0
new: 88.0

path: .metrics.halstead.N2
old: 62.0
new: 276.0

path: .metrics.halstead.effort
old: 7763.478260869565
new: 197153.0790057344

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

path: .metrics.nom.functions
old: 8.0
new: 5.0

Spaces Data

Minimal test - lines (30, 77)

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

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

path: .spaces[0].metrics.halstead.purity_ratio
old: 1.0050541319285822
new: 1.85760045733484

path: .spaces[0].metrics.halstead.time
old: 425.6105012105088
new: 1167.0195038472843

path: .spaces[0].metrics.halstead.effort
old: 7660.989021789159
new: 21006.35106925112

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

path: .spaces[0].metrics.halstead.length
old: 126.0
new: 163.0

path: .spaces[0].metrics.halstead.bugs
old: 0.12953942707881527
new: 0.25377324021917497

path: .spaces[0].metrics.halstead.estimated_program_length
old: 126.63682062300134
new: 302.7888745455789

path: .spaces[0].metrics.halstead.vocabulary
old: 31.0
new: 61.0

path: .spaces[0].metrics.halstead.volume
old: 624.2287351087463
new: 966.7101860227506

path: .spaces[0].metrics.halstead.N2
old: 60.0
new: 67.0

path: .spaces[0].metrics.halstead.N1
old: 66.0
new: 96.0

path: .spaces[0].metrics.halstead.level
old: 0.08148148148148147
new: 0.04601990049751243

path: .spaces[0].metrics.halstead.n2
old: 22.0
new: 37.0

path: .spaces[0].metrics.halstead.difficulty
old: 12.272727272727272
new: 21.72972972972973

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

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

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

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

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

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

path: .spaces[0].metrics.loc.ploc
old: 39.0
new: 37.0

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

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

path: .spaces[0].metrics.loc.lloc
old: 14.0
new: 13.0

path: .spaces[0].metrics.loc.sloc
old: 58.0
new: 48.0

path: .spaces[0].metrics.mi.mi_sei
old: 53.24777770213666
new: 27.575521397321268

path: .spaces[0].metrics.mi.mi_visual_studio
old: 40.07657048946943
new: 41.615362656401025

path: .spaces[0].metrics.mi.mi_original
old: 68.53093553699273
new: 71.16227014244575

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

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

Code

namespace TestThreadPoolListener {
static nsIThread** gCreatedThreadList = nullptr;
static nsIThread** gShutDownThreadList = nullptr;

static ReentrantMonitor* gReentrantMonitor = nullptr;

static bool gAllRunnablesPosted = false;
static bool gAllThreadsCreated = false;
static bool gAllThreadsShutDown = false;

class Listener final : public nsIThreadPoolListener {
  ~Listener() = default;

 public:
  NS_DECL_THREADSAFE_ISUPPORTS
  NS_DECL_NSITHREADPOOLLISTENER
};

NS_IMPL_ISUPPORTS(Listener, nsIThreadPoolListener)

NS_IMETHODIMP
Listener::OnThreadCreated() {
  nsCOMPtr current(do_GetCurrentThread());
  EXPECT_TRUE(current) << "Couldn't get current thread!";

  ReentrantMonitorAutoEnter mon(*gReentrantMonitor);

  while (!gAllRunnablesPosted) {
    mon.Wait();
  }

  for (uint32_t i = 0; i < NUMBER_OF_THREADS; i++) {
    nsIThread* thread = gCreatedThreadList[i];
    EXPECT_NE(thread, current) << "Saw the same thread twice!";

    if (!thread) {
      gCreatedThreadList[i] = current;
      if (i == (NUMBER_OF_THREADS - 1)) {
        gAllThreadsCreated = true;
        mon.NotifyAll();
      }
      return NS_OK;
    }
  }

  EXPECT_TRUE(false) << "Too many threads!";
  return NS_ERROR_FAILURE;
}

Minimal test - lines (41, 41)

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

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

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

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

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

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

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

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

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

path: .spaces[0].spaces[0].metrics.mi.mi_original
old: 69.4625080702717
new: 156.51435355291963

path: .spaces[0].spaces[0].metrics.mi.mi_sei
old: 53.468499241028155
new: 150.2034495661308

path: .spaces[0].spaces[0].metrics.mi.mi_visual_studio
old: 40.6213497486969
new: 91.5288617268536

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

path: .spaces[0].spaces[0].metrics.halstead.volume
old: 608.4544338554563
new: 15.509775004326936

path: .spaces[0].spaces[0].metrics.halstead.effort
old: 7692.602485172554
new: 38.77443751081734

path: .spaces[0].spaces[0].metrics.halstead.estimated_program_length
old: 120.76799089133478
new: 11.60964047443681

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

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

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

path: .spaces[0].spaces[0].metrics.halstead.length
old: 124.0
new: 6.0

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

path: .spaces[0].spaces[0].metrics.halstead.time
old: 427.36680473180854
new: 2.1541354172676304

path: .spaces[0].spaces[0].metrics.halstead.vocabulary
old: 30.0
new: 6.0

path: .spaces[0].spaces[0].metrics.halstead.bugs
old: 0.12989554981739232
new: 0.00381864321284214

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

path: .spaces[0].spaces[0].metrics.halstead.purity_ratio
old: 0.97393541041399
new: 1.9349400790728015

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

Code

  ~Listener() = default;