# Global Metrics

path: .metrics.nexits.average
old: 2.0
new: 0.0
path: .metrics.nexits.sum
old: 2.0
new: 0.0
path: .metrics.mi.mi_visual_studio
old: 41.737502991053915
new: 23.57710283736316
path: .metrics.mi.mi_original
old: 71.3711301147022
new: 40.316845851891
path: .metrics.mi.mi_sei
old: 60.622769820201135
new: 16.148086501158424
path: .metrics.cyclomatic.average
old: 1.3333333333333333
new: 16.5
path: .metrics.cyclomatic.sum
old: 4.0
new: 33.0
path: .metrics.halstead.n2
old: 44.0
new: 50.0
path: .metrics.halstead.vocabulary
old: 57.0
new: 73.0
path: .metrics.halstead.n1
old: 13.0
new: 23.0
path: .metrics.halstead.purity_ratio
old: 2.0022271358046897
new: 0.4827934180975593
path: .metrics.halstead.length
old: 144.0
new: 800.0
path: .metrics.halstead.estimated_program_length
old: 288.3207075558753
new: 386.2347344780474
path: .metrics.halstead.volume
old: 839.9361620397227
new: 4951.859647104014
path: .metrics.halstead.N1
old: 78.0
new: 535.0
path: .metrics.halstead.bugs
old: 0.13542931300005054
new: 1.4998233239892376
path: .metrics.halstead.difficulty
old: 9.75
new: 60.95
path: .metrics.halstead.N2
old: 66.0
new: 265.0
path: .metrics.halstead.effort
old: 8189.377579887297
new: 301815.8454909896
path: .metrics.halstead.time
old: 454.96542110484984
new: 16767.546971721647
path: .metrics.halstead.level
old: 0.10256410256410256
new: 0.016406890894175553
path: .metrics.cognitive.average
old: 1.0
new: 14.0
path: .metrics.cognitive.sum
old: 1.0
new: 14.0
path: .metrics.loc.ploc
old: 31.0
new: 100.0
path: .metrics.loc.blank
old: 9.0
new: 7.0
path: .metrics.loc.cloc
old: 11.0
new: 23.0
path: .metrics.loc.sloc
old: 51.0
new: 130.0
path: .metrics.loc.lloc
old: 6.0
new: 102.0
path: .metrics.nargs.average
old: 4.0
new: 5.0
path: .metrics.nargs.sum
old: 4.0
new: 5.0

# Spaces Data

## Minimal test - lines (20, 131)

path: .spaces[0].metrics.cognitive.sum
old: 1.0
new: 14.0
path: .spaces[0].metrics.cognitive.average
old: 1.0
new: 14.0
path: .spaces[0].metrics.loc.ploc
old: 25.0
new: 98.0
path: .spaces[0].metrics.loc.lloc
old: 6.0
new: 102.0
path: .spaces[0].metrics.loc.sloc
old: 35.0
new: 112.0
path: .spaces[0].metrics.loc.blank
old: 7.0
new: 2.0
path: .spaces[0].metrics.loc.cloc
old: 3.0
new: 12.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.7936736365702204
new: 0.46631594614527166
path: .spaces[0].metrics.halstead.length
old: 138.0
new: 798.0
path: .spaces[0].metrics.halstead.N2
old: 60.0
new: 263.0
path: .spaces[0].metrics.halstead.effort
old: 8033.945576444891
new: 309223.5064589093
path: .spaces[0].metrics.halstead.volume
old: 782.7946971920663
new: 4907.498201364737
path: .spaces[0].metrics.halstead.time
old: 446.3303098024939
new: 17179.08369216163
path: .spaces[0].metrics.halstead.level
old: 0.09743589743589744
new: 0.01587039180029757
path: .spaces[0].metrics.halstead.N1
old: 78.0
new: 535.0
path: .spaces[0].metrics.halstead.vocabulary
old: 51.0
new: 71.0
path: .spaces[0].metrics.halstead.n2
old: 38.0
new: 48.0
path: .spaces[0].metrics.halstead.difficulty
old: 10.263157894736842
new: 63.010416666666664
path: .spaces[0].metrics.halstead.estimated_program_length
old: 247.52696184669043
new: 372.1201250239268
path: .spaces[0].metrics.halstead.n1
old: 13.0
new: 23.0
path: .spaces[0].metrics.halstead.bugs
old: 0.1337102401701198
new: 1.524264771169958
path: .spaces[0].metrics.nexits.average
old: 2.0
new: 0.0
path: .spaces[0].metrics.nexits.sum
old: 2.0
new: 0.0
path: .spaces[0].metrics.cyclomatic.sum
old: 3.0
new: 32.0
path: .spaces[0].metrics.cyclomatic.average
old: 1.5
new: 32.0
path: .spaces[0].metrics.nargs.average
old: 4.0
new: 5.0
path: .spaces[0].metrics.nargs.sum
old: 4.0
new: 5.0
path: .spaces[0].metrics.mi.mi_original
old: 78.06643500487884
new: 43.00801657487531
path: .spaces[0].metrics.mi.mi_visual_studio
old: 45.65288596776541
new: 25.150886885891993
path: .spaces[0].metrics.mi.mi_sei
old: 59.13896605264823
new: 13.886722168709245

### 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())
        {
    #ifdef __LP64__
          /* 64 bit pointer mode */
          *((void**) dest) = source[indx].ptr;
    #else
          /* 32 bit pointer mode */
          uint32_t* adr = (uint32_t*) dest;
          *(adr) = 0;
          *(adr+1) = (uint32_t) source[indx].ptr;
    #endif
        }
        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
    #ifdef __LP64__
          /* 64 bit pointer mode */
          *((void**) dest) = source[indx].val.p;
    #else
          {
          /* 32 bit pointer mode */
          uint32_t* adr = (uint32_t*) dest;
          *(adr) = 0;
          *(adr+1) = (uint32_t) source[indx].val.p;
          }
    #endif
        }
        ++dest;
      }
      /* process register arguments */
      dest = iloc;
      for (indx = 0; indx < endlen; ++indx)
      {
        if (source[indx].IsPtrData())
        {
    #ifdef __LP64__
          /* 64 bit pointer mode */
          *((void**) dest) = source[indx].ptr;
    #else
          /* 32 bit pointer mode */
          uint32_t* adr = (uint32_t*) dest;
          *(adr) = 0;
          *(adr+1) = (uint32_t) source[indx].ptr;
    #endif
        }
        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
    #ifdef __LP64__
          /* 64 bit pointer mode */
          *((void**) dest) = source[indx].val.p;
    #else
          {
          /* 32 bit pointer mode */
          uint32_t* adr = (uint32_t*) dest;
          *(adr) = 0;
          *(adr+1) = (uint32_t) source[indx].val.p;
          }
    #endif
        }
        ++dest;
      }

    }