# Global Metrics

path: .metrics.nexits.sum
old: 2.0
new: 0.0
path: .metrics.nexits.average
old: 0.3333333333333333
new: 0.0
path: .metrics.cognitive.sum
old: 1.0
new: 0.0
path: .metrics.cognitive.average
old: 0.16666666666666666
new: 0.0
path: .metrics.loc.lloc
old: 7.0
new: 36.0
path: .metrics.loc.sloc
old: 88.0
new: 70.0
path: .metrics.loc.cloc
old: 7.0
new: 10.0
path: .metrics.loc.ploc
old: 65.0
new: 49.0
path: .metrics.loc.blank
old: 16.0
new: 11.0
path: .metrics.mi.mi_visual_studio
old: 32.633383653407435
new: 36.381918994504474
path: .metrics.mi.mi_original
old: 55.803086047326715
new: 62.21308148060265
path: .metrics.mi.mi_sei
old: 27.49134076859869
new: 41.88976899737497
path: .metrics.cyclomatic.average
old: 1.0714285714285714
new: 1.0
path: .metrics.cyclomatic.sum
old: 15.0
new: 2.0
path: .metrics.halstead.bugs
old: 0.3701741238909024
new: 0.5395540523490482
path: .metrics.halstead.length
old: 323.0
new: 351.0
path: .metrics.halstead.difficulty
old: 19.642857142857142
new: 32.708333333333336
path: .metrics.halstead.purity_ratio
old: 0.8826027575567669
new: 0.697209854661114
path: .metrics.halstead.estimated_program_length
old: 285.0806906908357
new: 244.720658986051
path: .metrics.halstead.N1
old: 213.0
new: 194.0
path: .metrics.halstead.level
old: 0.05090909090909091
new: 0.03057324840764331
path: .metrics.halstead.N2
old: 110.0
new: 157.0
path: .metrics.halstead.effort
old: 37007.60396487022
new: 65122.9881916715
path: .metrics.halstead.vocabulary
old: 57.0
new: 51.0
path: .metrics.halstead.time
old: 2055.9779980483454
new: 3617.9437884261943
path: .metrics.halstead.n2
old: 42.0
new: 36.0
path: .metrics.halstead.volume
old: 1884.0234745752111
new: 1991.021295031995
path: .metrics.nom.functions
old: 6.0
new: 1.0
path: .metrics.nom.total
old: 6.0
new: 1.0
path: .metrics.nargs.average
old: 2.3333333333333335
new: 2.0
path: .metrics.nargs.sum
old: 14.0
new: 2.0

# Spaces Data

## Minimal test - lines (17, 70)

path: .spaces[0].metrics.cognitive.sum
old: 1.0
new: 0.0
path: .spaces[0].metrics.cognitive.average
old: 0.16666666666666666
new: 0.0
path: .spaces[0].metrics.cyclomatic.sum
old: 14.0
new: 1.0
path: .spaces[0].metrics.cyclomatic.average
old: 1.0769230769230769
new: 1.0
path: .spaces[0].metrics.nom.functions
old: 6.0
new: 1.0
path: .spaces[0].metrics.nom.total
old: 6.0
new: 1.0
path: .spaces[0].metrics.loc.blank
old: 13.0
new: 6.0
path: .spaces[0].metrics.loc.cloc
old: 0.0
new: 5.0
path: .spaces[0].metrics.loc.ploc
old: 56.0
new: 43.0
path: .spaces[0].metrics.loc.sloc
old: 69.0
new: 54.0
path: .spaces[0].metrics.loc.lloc
old: 7.0
new: 36.0
path: .spaces[0].metrics.nexits.sum
old: 2.0
new: 0.0
path: .spaces[0].metrics.nexits.average
old: 0.3333333333333333
new: 0.0
path: .spaces[0].metrics.mi.mi_sei
old: 12.683279722543515
new: 43.63372379227049
path: .spaces[0].metrics.mi.mi_original
old: 60.27514562558653
new: 66.90662265126899
path: .spaces[0].metrics.mi.mi_visual_studio
old: 35.24862317285762
new: 39.1266799130228
path: .spaces[0].metrics.halstead.estimated_program_length
old: 238.1282645272016
new: 218.60335893412775
path: .spaces[0].metrics.halstead.n2
old: 35.0
new: 32.0
path: .spaces[0].metrics.halstead.bugs
old: 0.3824124307169132
new: 0.5500579318931965
path: .spaces[0].metrics.halstead.vocabulary
old: 50.0
new: 47.0
path: .spaces[0].metrics.halstead.volume
old: 1777.8146997790382
new: 1894.1147984220745
path: .spaces[0].metrics.halstead.level
old: 0.0457516339869281
new: 0.0282560706401766
path: .spaces[0].metrics.halstead.N2
old: 102.0
new: 151.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 0.7559627445307987
new: 0.6410655687217823
path: .spaces[0].metrics.halstead.time
old: 2158.7749925888324
new: 3724.105918772568
path: .spaces[0].metrics.halstead.length
old: 315.0
new: 341.0
path: .spaces[0].metrics.halstead.difficulty
old: 21.857142857142858
new: 35.390625
path: .spaces[0].metrics.halstead.N1
old: 213.0
new: 190.0
path: .spaces[0].metrics.halstead.effort
old: 38857.94986659898
new: 67033.90653790622
path: .spaces[0].metrics.nargs.average
old: 2.3333333333333335
new: 2.0
path: .spaces[0].metrics.nargs.sum
old: 14.0
new: 2.0

### Code

    TEST(TimeStamp, Main)
    {
      TimeDuration td;
      EXPECT_TRUE(td.ToSeconds() == 0.0);
      EXPECT_TRUE(TimeDuration::FromSeconds(5).ToSeconds() == 5.0);
      EXPECT_TRUE(TimeDuration::FromMilliseconds(5000).ToSeconds() == 5.0);
      EXPECT_TRUE(TimeDuration::FromSeconds(1) < TimeDuration::FromSeconds(2));
      EXPECT_FALSE(TimeDuration::FromSeconds(1) < TimeDuration::FromSeconds(1));
      EXPECT_TRUE(TimeDuration::FromSeconds(2) > TimeDuration::FromSeconds(1));
      EXPECT_FALSE(TimeDuration::FromSeconds(1) > TimeDuration::FromSeconds(1));
      EXPECT_TRUE(TimeDuration::FromSeconds(1) <= TimeDuration::FromSeconds(2));
      EXPECT_TRUE(TimeDuration::FromSeconds(1) <= TimeDuration::FromSeconds(1));
      EXPECT_FALSE(TimeDuration::FromSeconds(2) <= TimeDuration::FromSeconds(1));
      EXPECT_TRUE(TimeDuration::FromSeconds(2) >= TimeDuration::FromSeconds(1));
      EXPECT_TRUE(TimeDuration::FromSeconds(1) >= TimeDuration::FromSeconds(1));
      EXPECT_FALSE(TimeDuration::FromSeconds(1) >= TimeDuration::FromSeconds(2));

      TimeStamp ts;
      EXPECT_TRUE(ts.IsNull());

      ts = TimeStamp::Now();
      EXPECT_TRUE(!ts.IsNull());
      EXPECT_TRUE((ts - ts).ToSeconds() == 0.0);

      PR_Sleep(PR_SecondsToInterval(2));

      TimeStamp ts2(TimeStamp::Now());
      EXPECT_TRUE(ts2 > ts);
      EXPECT_FALSE(ts > ts);
      EXPECT_TRUE(ts < ts2);
      EXPECT_FALSE(ts < ts);
      EXPECT_TRUE(ts <= ts2);
      EXPECT_TRUE(ts <= ts);
      EXPECT_FALSE(ts2 <= ts);
      EXPECT_TRUE(ts2 >= ts);
      EXPECT_TRUE(ts2 >= ts);
      EXPECT_FALSE(ts >= ts2);

      // We can't be sure exactly how long PR_Sleep slept for. It should have
      // slept for at least one second. We might have slept a lot longer due
      // to process scheduling, but hopefully not more than 10 seconds.
      td = ts2 - ts;
      EXPECT_TRUE(td.ToSeconds() > 1.0);
      EXPECT_TRUE(td.ToSeconds() < 20.0);
      td = ts - ts2;
      EXPECT_TRUE(td.ToSeconds() < -1.0);
      EXPECT_TRUE(td.ToSeconds() > -20.0);

      double resolution = TimeDuration::Resolution().ToSecondsSigDigits();
      printf(" (platform timer resolution is ~%g s)\n", resolution);
      EXPECT_TRUE(1e-10 < resolution);
      // Don't upper-bound sanity check ... although NSPR reports 1ms
      // resolution, it might be lying, so we shouldn't compare with it
    }