# Global Metrics

path: .metrics.cyclomatic.average
old: 1.0
new: 9.5
path: .metrics.cyclomatic.sum
old: 9.0
new: 19.0
path: .metrics.mi.mi_sei
old: 56.981692257846426
new: 41.52115081066629
path: .metrics.mi.mi_visual_studio
old: 36.96594739165261
new: 34.91977757443568
path: .metrics.mi.mi_original
old: 63.21177003972596
new: 59.712819652285006
path: .metrics.cognitive.average
old: 0.0
new: 11.0
path: .metrics.cognitive.sum
old: 0.0
new: 11.0
path: .metrics.loc.cloc
old: 28.0
new: 10.0
path: .metrics.loc.lloc
old: 0.0
new: 51.0
path: .metrics.loc.blank
old: 1.0
new: 6.0
path: .metrics.loc.sloc
old: 75.0
new: 62.0
path: .metrics.nom.total
old: 4.0
new: 1.0
path: .metrics.nom.functions
old: 4.0
new: 1.0
path: .metrics.halstead.difficulty
old: 10.304347826086955
new: 26.138297872340427
path: .metrics.halstead.effort
old: 10020.20383957865
new: 57918.19379943147
path: .metrics.halstead.volume
old: 972.4248451911768
new: 2215.8364742151234
path: .metrics.halstead.n2
old: 46.0
new: 47.0
path: .metrics.halstead.N2
old: 79.0
new: 117.0
path: .metrics.halstead.n1
old: 12.0
new: 21.0
path: .metrics.halstead.estimated_program_length
old: 297.1033999872765
new: 353.3043419072029
path: .metrics.halstead.time
old: 556.6779910877027
new: 3217.6774333017484
path: .metrics.halstead.N1
old: 87.0
new: 247.0
path: .metrics.halstead.purity_ratio
old: 1.7897795179956415
new: 0.9706163239208871
path: .metrics.halstead.vocabulary
old: 58.0
new: 68.0
path: .metrics.halstead.bugs
old: 0.15492795304621867
new: 0.49898644918757806
path: .metrics.halstead.length
old: 166.0
new: 364.0
path: .metrics.halstead.level
old: 0.0970464135021097
new: 0.03825803825803826
path: .metrics.nargs.average
old: 0.5
new: 4.0
path: .metrics.nargs.sum
old: 2.0
new: 4.0

# Spaces Data

## Minimal test - lines (11, 61)

path: .spaces[0].metrics.mi.mi_sei
old: 63.247598965511216
new: 42.65424258183464
path: .spaces[0].metrics.mi.mi_original
old: 67.63715634882567
new: 63.20576073319105
path: .spaces[0].metrics.mi.mi_visual_studio
old: 39.55389260165243
new: 36.9624331773047
path: .spaces[0].metrics.loc.cloc
old: 22.0
new: 6.0
path: .spaces[0].metrics.loc.lloc
old: 0.0
new: 51.0
path: .spaces[0].metrics.loc.sloc
old: 59.0
new: 51.0
path: .spaces[0].metrics.loc.blank
old: 0.0
new: 2.0
path: .spaces[0].metrics.loc.ploc
old: 39.0
new: 43.0
path: .spaces[0].metrics.halstead.bugs
old: 0.15255164262649787
new: 0.5060064429226635
path: .spaces[0].metrics.halstead.n2
old: 41.0
new: 44.0
path: .spaces[0].metrics.halstead.effort
old: 9790.552815994854
new: 59144.71618778219
path: .spaces[0].metrics.halstead.N1
old: 87.0
new: 247.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.6417448887374708
new: 0.9209242578902912
path: .spaces[0].metrics.halstead.volume
old: 916.4672727301116
new: 2174.074780503272
path: .spaces[0].metrics.halstead.level
old: 0.09360730593607304
new: 0.03675856307435255
path: .spaces[0].metrics.halstead.estimated_program_length
old: 262.6791821979953
new: 332.45365709839507
path: .spaces[0].metrics.halstead.length
old: 160.0
new: 361.0
path: .spaces[0].metrics.halstead.n1
old: 12.0
new: 21.0
path: .spaces[0].metrics.halstead.vocabulary
old: 53.0
new: 65.0
path: .spaces[0].metrics.halstead.difficulty
old: 10.682926829268292
new: 27.204545454545453
path: .spaces[0].metrics.halstead.N2
old: 73.0
new: 114.0
path: .spaces[0].metrics.halstead.time
old: 543.919600888603
new: 3285.8175659879
path: .spaces[0].metrics.cyclomatic.average
old: 1.0
new: 18.0
path: .spaces[0].metrics.cyclomatic.sum
old: 8.0
new: 18.0
path: .spaces[0].metrics.nargs.sum
old: 2.0
new: 4.0
path: .spaces[0].metrics.nargs.average
old: 0.5
new: 4.0
path: .spaces[0].metrics.cognitive.average
old: 0.0
new: 11.0
path: .spaces[0].metrics.cognitive.sum
old: 0.0
new: 11.0
path: .spaces[0].metrics.nom.functions
old: 4.0
new: 1.0
path: .spaces[0].metrics.nom.total
old: 4.0
new: 1.0

### Code

    extern "C" void
    invoke_copy_to_stack(uint64_t* d, uint32_t paramCount, nsXPTCVariant* s, double *fprData)
    {
    /*
        We need to copy the parameters for this function to locals and use them
        from there since the parameters occupy the same stack space as the stack
        we're trying to populate.
    */
        uint64_t *l_d = d;
        nsXPTCVariant *l_s = s;
        uint32_t l_paramCount = paramCount, fpCount = 0;
        double *l_fprData = fprData;

        for(uint32_t i = 0; i < l_paramCount; i++, l_d++, l_s++)
        {
            if(l_s->IsPtrData())
            {
                *l_d = (uint64_t)l_s->ptr;
                continue;
            }
            switch(l_s->type)
            {
            case nsXPTType::T_I8:    *l_d = (uint64_t)l_s->val.i8;   break;
            case nsXPTType::T_I16:   *l_d = (uint64_t)l_s->val.i16;  break;
            case nsXPTType::T_I32:   *l_d = (uint64_t)l_s->val.i32;  break;
            case nsXPTType::T_I64:   *l_d = (uint64_t)l_s->val.i64;  break;
            case nsXPTType::T_U8:    *l_d = (uint64_t)l_s->val.u8;   break;
            case nsXPTType::T_U16:   *l_d = (uint64_t)l_s->val.u16;  break;
            case nsXPTType::T_U32:   *l_d = (uint64_t)l_s->val.u32;  break;
            case nsXPTType::T_U64:   *l_d = (uint64_t)l_s->val.u64;  break;
            case nsXPTType::T_BOOL:  *l_d = (uint64_t)l_s->val.b;    break;
            case nsXPTType::T_CHAR:  *l_d = (uint64_t)l_s->val.c;    break;
            case nsXPTType::T_WCHAR: *l_d = (uint64_t)l_s->val.wc;   break;

            case nsXPTType::T_DOUBLE:
                *((double*)l_d) = l_s->val.d;
                if(fpCount < 13)
                    l_fprData[fpCount++] = l_s->val.d;
                break;
            case nsXPTType::T_FLOAT:
                *((float*)l_d) = l_s->val.f;
                if(fpCount < 13)
                    l_fprData[fpCount++] = l_s->val.f;
                break;
            default:
                // all the others are plain pointer types
                *l_d = (uint64_t)l_s->val.p;
                break;
            }
        }
    }