# Global Metrics

path: .metrics.nexits.average
old: 2.3333333333333335
new: 0.6666666666666666
path: .metrics.nexits.sum
old: 7.0
new: 2.0
path: .metrics.mi.mi_original
old: 12.650749766550334
new: 43.5388342030392
path: .metrics.mi.mi_sei
old: -25.51497804023842
new: 11.948489867572128
path: .metrics.mi.mi_visual_studio
old: 7.398099278684406
new: 25.461306551484917
path: .metrics.halstead.N1
old: 698.0
new: 402.0
path: .metrics.halstead.estimated_program_length
old: 1156.6447209383173
new: 407.6217090811608
path: .metrics.halstead.n1
old: 37.0
new: 23.0
path: .metrics.halstead.purity_ratio
old: 0.8987138468829194
new: 0.7052278703826311
path: .metrics.halstead.length
old: 1287.0
new: 578.0
path: .metrics.halstead.bugs
old: 2.7921325010860576
new: 0.8897699168902483
path: .metrics.halstead.time
old: 42590.56612863761
new: 7661.714314473033
path: .metrics.halstead.vocabulary
old: 173.0
new: 76.0
path: .metrics.halstead.difficulty
old: 80.12132352941177
new: 38.18867924528302
path: .metrics.halstead.N2
old: 589.0
new: 176.0
path: .metrics.halstead.effort
old: 766630.1903154771
new: 137910.8576605146
path: .metrics.halstead.volume
old: 9568.366528968463
new: 3611.302102770392
path: .metrics.halstead.level
old: 0.012481071903822328
new: 0.02618577075098814
path: .metrics.halstead.n2
old: 136.0
new: 53.0
path: .metrics.loc.sloc
old: 437.0
new: 113.0
path: .metrics.loc.ploc
old: 276.0
new: 95.0
path: .metrics.loc.cloc
old: 57.0
new: 9.0
path: .metrics.loc.lloc
old: 142.0
new: 92.0
path: .metrics.loc.blank
old: 104.0
new: 9.0
path: .metrics.cognitive.sum
old: 65.0
new: 16.0
path: .metrics.cognitive.average
old: 21.666666666666668
new: 5.333333333333333
path: .metrics.cyclomatic.sum
old: 53.0
new: 36.0
path: .metrics.cyclomatic.average
old: 13.25
new: 9.0
path: .metrics.nargs.sum
old: 5.0
new: 10.0
path: .metrics.nargs.average
old: 1.6666666666666667
new: 3.3333333333333335

# Spaces Data

## Minimal test - lines (10, 59)

path: .spaces[0].metrics.mi.mi_sei
old: 75.04218078768388
new: 40.81141809835617
path: .spaces[0].metrics.mi.mi_visual_studio
old: 61.06229942212335
new: 40.388147029116254
path: .spaces[0].metrics.mi.mi_original
old: 104.41653201183092
new: 69.0637314197888
path: .spaces[0].metrics.halstead.time
old: 43.53767238483316
new: 872.3222260213943
path: .spaces[0].metrics.halstead.N1
old: 18.0
new: 108.0
path: .spaces[0].metrics.halstead.n2
old: 11.0
new: 23.0
path: .spaces[0].metrics.halstead.estimated_program_length
old: 53.5635228093372
new: 196.28059086766527
path: .spaces[0].metrics.halstead.volume
old: 151.23612512626255
new: 818.9147427955946
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.4476627786307352
new: 1.3085372724511015
path: .spaces[0].metrics.halstead.length
old: 37.0
new: 150.0
path: .spaces[0].metrics.halstead.level
old: 0.1929824561403509
new: 0.05215419501133787
path: .spaces[0].metrics.halstead.n1
old: 6.0
new: 21.0
path: .spaces[0].metrics.halstead.vocabulary
old: 17.0
new: 44.0
path: .spaces[0].metrics.halstead.bugs
old: 0.02833373884859452
new: 0.20901544258452967
path: .spaces[0].metrics.halstead.effort
old: 783.6781029269969
new: 15701.800068385097
path: .spaces[0].metrics.halstead.N2
old: 19.0
new: 42.0
path: .spaces[0].metrics.halstead.difficulty
old: 5.181818181818182
new: 19.17391304347826
path: .spaces[0].metrics.cognitive.average
old: 0.0
new: 5.0
path: .spaces[0].metrics.cognitive.sum
old: 0.0
new: 5.0
path: .spaces[0].metrics.loc.lloc
old: 4.0
new: 36.0
path: .spaces[0].metrics.loc.cloc
old: 0.0
new: 2.0
path: .spaces[0].metrics.loc.ploc
old: 9.0
new: 47.0
path: .spaces[0].metrics.loc.blank
old: 3.0
new: 1.0
path: .spaces[0].metrics.loc.sloc
old: 12.0
new: 50.0
path: .spaces[0].metrics.cyclomatic.sum
old: 1.0
new: 16.0
path: .spaces[0].metrics.cyclomatic.average
old: 1.0
new: 16.0
path: .spaces[0].metrics.nexits.average
old: 0.0
new: 1.0
path: .spaces[0].metrics.nexits.sum
old: 0.0
new: 1.0
path: .spaces[0].metrics.nargs.sum
old: 1.0
new: 2.0
path: .spaces[0].metrics.nargs.average
old: 1.0
new: 2.0

### Code

    extern "C" uint32_t
    invoke_count_words(uint32_t paramCount, nsXPTCVariant* s)
    {
        uint32_t result = 0;
        /*    fprintf(stderr,"invoke_count_words(%d,%p)\n",paramCount, s);*/

        for(uint32_t i = 0; i < paramCount; i++, s++)
        {
            if(s->IsPtrData())
            {
                result++;
                continue;
            }
            switch(s->type)
            {
            case nsXPTType::T_I8     :
            case nsXPTType::T_I16    :
            case nsXPTType::T_I32    :
                result++;
                break;
            case nsXPTType::T_I64    :
                result+=2;
                break;
            case nsXPTType::T_U8     :
            case nsXPTType::T_U16    :
            case nsXPTType::T_U32    :
                result++;
                break;
            case nsXPTType::T_U64    :
                result+=2;
                break;
            case nsXPTType::T_FLOAT  :
                result++;
                break;
            case nsXPTType::T_DOUBLE :
                result+=2;
                break;
            case nsXPTType::T_BOOL   :
            case nsXPTType::T_CHAR   :
            case nsXPTType::T_WCHAR  :
                result++;
                break;
            default:
                // all the others are plain pointer types
                result++;
                break;
            }
        }
        return result;
    }

## Minimal test - lines (109, 113)

path: .spaces[2].metrics.cognitive.sum
old: 62.0
new: 0.0
path: .spaces[2].metrics.cognitive.average
old: 62.0
new: 0.0
path: .spaces[2].metrics.halstead.purity_ratio
old: 0.8832767596186604
new: 1.616721646459379
path: .spaces[2].metrics.halstead.bugs
old: 2.554459655146002
new: 0.022479239973047977
path: .spaces[2].metrics.halstead.time
old: 37269.87608273087
new: 30.76676344041708
path: .spaces[2].metrics.halstead.estimated_program_length
old: 1031.6672552345954
new: 43.65148445440323
path: .spaces[2].metrics.halstead.vocabulary
old: 158.0
new: 15.0
path: .spaces[2].metrics.halstead.difficulty
old: 78.63934426229508
new: 5.25
path: .spaces[2].metrics.halstead.effort
old: 670857.7694891557
new: 553.8017419275075
path: .spaces[2].metrics.halstead.n2
old: 122.0
new: 8.0
path: .spaces[2].metrics.halstead.length
old: 1168.0
new: 27.0
path: .spaces[2].metrics.halstead.N2
old: 533.0
new: 12.0
path: .spaces[2].metrics.halstead.volume
old: 8530.815913870856
new: 105.48604608143
path: .spaces[2].metrics.halstead.level
old: 0.012716281008963937
new: 0.1904761904761905
path: .spaces[2].metrics.halstead.n1
old: 36.0
new: 7.0
path: .spaces[2].metrics.halstead.N1
old: 635.0
new: 15.0
path: .spaces[2].metrics.nexits.average
old: 4.0
new: 1.0
path: .spaces[2].metrics.nexits.sum
old: 4.0
new: 1.0
path: .spaces[2].metrics.cyclomatic.average
old: 48.0
new: 1.0
path: .spaces[2].metrics.cyclomatic.sum
old: 48.0
new: 1.0
path: .spaces[2].metrics.nargs.average
old: 2.0
new: 4.0
path: .spaces[2].metrics.nargs.sum
old: 2.0
new: 4.0
path: .spaces[2].metrics.loc.blank
old: 68.0
new: 0.0
path: .spaces[2].metrics.loc.sloc
old: 338.0
new: 5.0
path: .spaces[2].metrics.loc.ploc
old: 238.0
new: 5.0
path: .spaces[2].metrics.loc.lloc
old: 132.0
new: 1.0
path: .spaces[2].metrics.loc.cloc
old: 32.0
new: 0.0
path: .spaces[2].metrics.mi.mi_original
old: 18.559166994627404
new: 120.47249668497318
path: .spaces[2].metrics.mi.mi_visual_studio
old: 10.85331403194585
new: 70.45175244735273
path: .spaces[2].metrics.mi.mi_sei
old: -21.096917668141643
new: 98.2060413983146

### Code

    NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
                     uint32_t paramCount, nsXPTCVariant* params)
    {
        return _NS_InvokeByIndex(that, methodIndex, paramCount, params);
    }

## Minimal test - lines (61, 102)

path: .spaces[1].metrics.nexits.sum
old: 3.0
new: 0.0
path: .spaces[1].metrics.nexits.average
old: 3.0
new: 0.0
path: .spaces[1].metrics.mi.mi_visual_studio
old: 55.45019399404649
new: 38.72462935762031
path: .spaces[1].metrics.mi.mi_sei
old: 61.40070860073723
new: 38.2488523955029
path: .spaces[1].metrics.mi.mi_original
old: 94.8198317298195
new: 66.21911620153072
path: .spaces[1].metrics.halstead.n2
old: 13.0
new: 40.0
path: .spaces[1].metrics.halstead.time
old: 213.8700071754197
new: 3512.1826513047417
path: .spaces[1].metrics.halstead.n1
old: 13.0
new: 21.0
path: .spaces[1].metrics.halstead.purity_ratio
old: 1.5271655979629903
new: 0.8114781640261927
path: .spaces[1].metrics.halstead.volume
old: 296.1277022428888
new: 2229.9572389236455
path: .spaces[1].metrics.halstead.level
old: 0.07692307692307693
new: 0.03527336860670194
path: .spaces[1].metrics.halstead.vocabulary
old: 26.0
new: 61.0
path: .spaces[1].metrics.halstead.effort
old: 3849.6601291575544
new: 63219.28772348535
path: .spaces[1].metrics.halstead.difficulty
old: 13.0
new: 28.35
path: .spaces[1].metrics.halstead.estimated_program_length
old: 96.2114326716684
new: 305.11578967384844
path: .spaces[1].metrics.halstead.N1
old: 37.0
new: 268.0
path: .spaces[1].metrics.halstead.N2
old: 26.0
new: 108.0
path: .spaces[1].metrics.halstead.length
old: 63.0
new: 376.0
path: .spaces[1].metrics.halstead.bugs
old: 0.08187670145162297
new: 0.5289871765902161
path: .spaces[1].metrics.cognitive.sum
old: 3.0
new: 11.0
path: .spaces[1].metrics.cognitive.average
old: 3.0
new: 11.0
path: .spaces[1].metrics.nargs.sum
old: 2.0
new: 4.0
path: .spaces[1].metrics.nargs.average
old: 2.0
new: 4.0
path: .spaces[1].metrics.loc.ploc
old: 14.0
new: 38.0
path: .spaces[1].metrics.loc.cloc
old: 0.0
new: 2.0
path: .spaces[1].metrics.loc.blank
old: 3.0
new: 2.0
path: .spaces[1].metrics.loc.lloc
old: 5.0
new: 54.0
path: .spaces[1].metrics.loc.sloc
old: 17.0
new: 42.0
path: .spaces[1].metrics.cyclomatic.sum
old: 3.0
new: 18.0
path: .spaces[1].metrics.cyclomatic.average
old: 3.0
new: 18.0

### Code

    extern "C" void
    invoke_copy_to_stack(uint32_t* d, uint32_t paramCount, nsXPTCVariant* s, double *fprData)
    {
    	uint32_t fpCount = 0;

        /*    fprintf(stderr,"invoke_copy_to_stack(%p, %d, %p, %p)\n", d, paramCount, s, fprData);*/

        for(uint32_t i = 0; i < paramCount; i++, d++, s++)
        {
            if(s->IsPtrData())
            {
                *((void**)d) = s->ptr;
                continue;
            }
            switch(s->type)
            {
            case nsXPTType::T_I8     : *((int32_t*) d) = s->val.i8;          break;
            case nsXPTType::T_I16    : *((int32_t*) d) = s->val.i16;         break;
            case nsXPTType::T_I32    : *((int32_t*) d) = s->val.i32;         break;
            case nsXPTType::T_I64    : *((int64_t*) d) = s->val.i64; d++;    break;
            case nsXPTType::T_U8     : *((uint32_t*) d) = s->val.u8;          break;
            case nsXPTType::T_U16    : *((uint32_t*)d) = s->val.u16;         break;
            case nsXPTType::T_U32    : *((uint32_t*)d) = s->val.u32;         break;
            case nsXPTType::T_U64    : *((uint64_t*)d) = s->val.u64; d++;    break;
            case nsXPTType::T_FLOAT  : *((float*)   d) = s->val.f;
            			   if (fpCount < 13)
            		               fprData[fpCount++] = s->val.f;
            			   break;
            case nsXPTType::T_DOUBLE : *((double*)  d) = s->val.d;   d++;
            			   if (fpCount < 13)
            			       fprData[fpCount++] = s->val.d;
            			   break;
            case nsXPTType::T_BOOL   : *((uint32_t*) d) = s->val.b;          break;
            case nsXPTType::T_CHAR   : *((int32_t*)  d) = s->val.c;          break;
            case nsXPTType::T_WCHAR  : *((uint32_t*) d) = s->val.wc;         break;
            default:
                // all the others are plain pointer types
                *((void**)d) = s->val.p;
                break;
            }
        }
    }