# Global Metrics

path: .metrics.halstead.estimated_program_length
old: 1768.986229174986
new: 359.17317163886946
path: .metrics.halstead.bugs
old: 4.735654695015758
new: 1.19584809075856
path: .metrics.halstead.purity_ratio
old: 0.8110895136061376
new: 0.532897880769836
path: .metrics.halstead.time
old: 94076.1246245941
new: 11937.77526232789
path: .metrics.halstead.vocabulary
old: 244.0
new: 69.0
path: .metrics.halstead.volume
old: 17296.938133224656
new: 4117.145483868486
path: .metrics.halstead.length
old: 2181.0
new: 674.0
path: .metrics.halstead.difficulty
old: 97.9
new: 52.191489361702125
path: .metrics.halstead.N1
old: 1291.0
new: 451.0
path: .metrics.halstead.level
old: 0.010214504596527068
new: 0.019160211985324093
path: .metrics.halstead.n1
old: 44.0
new: 22.0
path: .metrics.halstead.n2
old: 200.0
new: 47.0
path: .metrics.halstead.effort
old: 1693370.2432426938
new: 214879.95472190203
path: .metrics.halstead.N2
old: 890.0
new: 223.0
path: .metrics.nom.total
old: 17.0
new: 1.0
path: .metrics.nom.functions
old: 17.0
new: 1.0
path: .metrics.mi.mi_sei
old: -52.00846182217873
new: 25.3355986717074
path: .metrics.mi.mi_visual_studio
old: 0.0
new: 26.815419287346018
path: .metrics.mi.mi_original
old: -6.046500908020931
new: 45.85436698136169
path: .metrics.cognitive.average
old: 8.058823529411764
new: 14.0
path: .metrics.cognitive.sum
old: 137.0
new: 14.0
path: .metrics.loc.sloc
old: 540.0
new: 98.0
path: .metrics.loc.lloc
old: 247.0
new: 94.0
path: .metrics.loc.blank
old: 48.0
new: 7.0
path: .metrics.loc.ploc
old: 447.0
new: 72.0
path: .metrics.loc.cloc
old: 45.0
new: 19.0
path: .metrics.nargs.average
old: 1.7058823529411764
new: 5.0
path: .metrics.nargs.sum
old: 29.0
new: 5.0
path: .metrics.cyclomatic.sum
old: 106.0
new: 33.0
path: .metrics.cyclomatic.average
old: 5.0476190476190474
new: 16.5
path: .metrics.nexits.sum
old: 29.0
new: 0.0
path: .metrics.nexits.average
old: 1.7058823529411764
new: 0.0

# Spaces Data

## Minimal test - lines (20, 99)

path: .spaces[0].metrics.nom.functions
old: 17.0
new: 1.0
path: .spaces[0].metrics.nom.total
old: 17.0
new: 1.0
path: .spaces[0].metrics.cognitive.sum
old: 137.0
new: 14.0
path: .spaces[0].metrics.cognitive.average
old: 8.058823529411764
new: 14.0
path: .spaces[0].metrics.mi.mi_sei
old: -51.78255346259184
new: 22.38751949006587
path: .spaces[0].metrics.mi.mi_original
old: -5.111205744530437
new: 49.4237117625739
path: .spaces[0].metrics.mi.mi_visual_studio
old: 0.0
new: 28.902755416709883
path: .spaces[0].metrics.nexits.sum
old: 29.0
new: 0.0
path: .spaces[0].metrics.nexits.average
old: 1.7058823529411764
new: 0.0
path: .spaces[0].metrics.loc.lloc
old: 247.0
new: 94.0
path: .spaces[0].metrics.loc.blank
old: 42.0
new: 2.0
path: .spaces[0].metrics.loc.ploc
old: 438.0
new: 70.0
path: .spaces[0].metrics.loc.sloc
old: 519.0
new: 80.0
path: .spaces[0].metrics.loc.cloc
old: 39.0
new: 8.0
path: .spaces[0].metrics.cyclomatic.average
old: 5.25
new: 32.0
path: .spaces[0].metrics.cyclomatic.sum
old: 105.0
new: 32.0
path: .spaces[0].metrics.halstead.N2
old: 881.0
new: 221.0
path: .spaces[0].metrics.halstead.estimated_program_length
old: 1696.5277913585032
new: 345.2408849448559
path: .spaces[0].metrics.halstead.level
old: 0.009906098441853266
new: 0.01851090086384204
path: .spaces[0].metrics.halstead.n1
old: 44.0
new: 22.0
path: .spaces[0].metrics.halstead.volume
old: 17089.570131016473
new: 4076.411935987622
path: .spaces[0].metrics.halstead.purity_ratio
old: 0.7825312690768004
new: 0.5137513168822261
path: .spaces[0].metrics.halstead.length
old: 2168.0
new: 672.0
path: .spaces[0].metrics.halstead.bugs
old: 4.794732816729985
new: 1.2155675139298487
path: .spaces[0].metrics.halstead.vocabulary
old: 236.0
new: 67.0
path: .spaces[0].metrics.halstead.effort
old: 1725156.501455007
new: 220216.83147524248
path: .spaces[0].metrics.halstead.N1
old: 1287.0
new: 451.0
path: .spaces[0].metrics.halstead.n2
old: 192.0
new: 45.0
path: .spaces[0].metrics.halstead.time
old: 95842.02785861147
new: 12234.268415291248
path: .spaces[0].metrics.halstead.difficulty
old: 100.94791666666669
new: 54.022222222222226
path: .spaces[0].metrics.nargs.average
old: 1.7058823529411764
new: 5.0
path: .spaces[0].metrics.nargs.sum
old: 29.0
new: 5.0

### Code

    extern "C" void
    invoke_copy_to_stack(uint64_t* mloc, uint64_t* iloc, uint64_t* floc,
      const uint32_t paramCount, nsXPTCVariant* s)
    {
      uint64_t* dest = mloc;
      uint32_t len = paramCount;
      nsXPTCVariant* source = s;

      uint32_t indx;
      uint32_t endlen;
      endlen = (len > 7) ? 7 : len;
      /* handle the memory arguments */
      for (indx = 7; indx < len; ++indx)
      {
        if (source[indx].IsPtrData())
        {
          /* 64 bit pointer mode */
          *((void**) dest) = source[indx].ptr;
        }
        else
        switch (source[indx].type)
        {
        case nsXPTType::T_I8    : *(dest) = source[indx].val.i8;  break;
        case nsXPTType::T_I16   : *(dest) = source[indx].val.i16; break;
        case nsXPTType::T_I32   : *(dest) = source[indx].val.i32; break;
        case nsXPTType::T_I64   : *(dest) = source[indx].val.i64; break;
        case nsXPTType::T_U8    : *(dest) = source[indx].val.u8;  break;
        case nsXPTType::T_U16   : *(dest) = source[indx].val.u16; break;
        case nsXPTType::T_U32   : *(dest) = source[indx].val.u32; break;
        case nsXPTType::T_U64   : *(dest) = source[indx].val.u64; break;
        case nsXPTType::T_FLOAT : *(dest) = source[indx].val.u32; break;
        case nsXPTType::T_DOUBLE: *(dest) = source[indx].val.u64; break;
        case nsXPTType::T_BOOL  : *(dest) = source[indx].val.b; break;
        case nsXPTType::T_CHAR  : *(dest) = source[indx].val.c; break;
        case nsXPTType::T_WCHAR : *(dest) = source[indx].val.wc; break;
        default:
        // all the others are plain pointer types
          /* 64 bit pointer mode */
          *((void**) dest) = source[indx].val.p;
        }
        ++dest;
      }
      /* process register arguments */
      dest = iloc;
      for (indx = 0; indx < endlen; ++indx)
      {
        if (source[indx].IsPtrData())
        {
          /* 64 bit pointer mode */
          *((void**) dest) = source[indx].ptr;
        }
        else
        switch (source[indx].type)
        {
        case nsXPTType::T_I8    : *(dest) = source[indx].val.i8; break;
        case nsXPTType::T_I16   : *(dest) = source[indx].val.i16; break;
        case nsXPTType::T_I32   : *(dest) = source[indx].val.i32; break;
        case nsXPTType::T_I64   : *(dest) = source[indx].val.i64; break;
        case nsXPTType::T_U8    : *(dest) = source[indx].val.u8; break;
        case nsXPTType::T_U16   : *(dest) = source[indx].val.u16; break;
        case nsXPTType::T_U32   : *(dest) = source[indx].val.u32; break;
        case nsXPTType::T_U64   : *(dest) = source[indx].val.u64; break;
        case nsXPTType::T_FLOAT :
          *((double*) (floc++)) = (double) source[indx].val.f;
          break;
        case nsXPTType::T_DOUBLE:
          *((double*) (floc++)) = source[indx].val.d;
          break;
        case nsXPTType::T_BOOL  : *(dest) = source[indx].val.b; break;
        case nsXPTType::T_CHAR  : *(dest) = source[indx].val.c; break;
        case nsXPTType::T_WCHAR : *(dest) = source[indx].val.wc; break;
        default:
        // all the others are plain pointer types
          /* 64 bit pointer mode */
          *((void**) dest) = source[indx].val.p;
        }
        ++dest;
      }

    }