Global Metrics

path: .metrics.cognitive.sum
old: 0.0
new: 5.0

path: .metrics.cognitive.average
old: 0.0
new: 2.5

path: .metrics.mi.mi_visual_studio
old: 52.80414358390958
new: 35.59555830165405

path: .metrics.mi.mi_sei
old: 93.2934820415759
new: 42.60036189454803

path: .metrics.mi.mi_original
old: 90.2950855284854
new: 60.86840469582843

path: .metrics.loc.cloc
old: 8.0
new: 9.0

path: .metrics.loc.blank
old: 5.0
new: 7.0

path: .metrics.loc.lloc
old: 3.0
new: 48.0

path: .metrics.loc.ploc
old: 12.0
new: 42.0

path: .metrics.loc.sloc
old: 25.0
new: 58.0

path: .metrics.cyclomatic.average
old: 1.0
new: 6.0

path: .metrics.cyclomatic.sum
old: 3.0
new: 18.0

path: .metrics.nargs.sum
old: 1.0
new: 7.0

path: .metrics.nargs.average
old: 0.5
new: 3.5

path: .metrics.halstead.purity_ratio
old: 1.7411126366337717
new: 0.9364675048643912

path: .metrics.halstead.N2
old: 19.0
new: 112.0

path: .metrics.halstead.n2
old: 14.0
new: 45.0

path: .metrics.halstead.n1
old: 9.0
new: 23.0

path: .metrics.halstead.N1
old: 28.0
new: 263.0

path: .metrics.halstead.volume
old: 212.6074119346796
new: 2282.7985654688773

path: .metrics.halstead.effort
old: 1298.4238371725075
new: 65338.767829420314

path: .metrics.halstead.vocabulary
old: 23.0
new: 68.0

path: .metrics.halstead.difficulty
old: 6.107142857142857
new: 28.622222222222224

path: .metrics.halstead.bugs
old: 0.03967251489648423
new: 0.5407452403018944

path: .metrics.halstead.length
old: 47.0
new: 375.0

path: .metrics.halstead.estimated_program_length
old: 81.83229392178727
new: 351.17531432414665

path: .metrics.halstead.time
old: 72.13465762069487
new: 3629.931546078906

path: .metrics.halstead.level
old: 0.16374269005847955
new: 0.03493788819875776

Spaces Data

Minimal test - lines (54, 58)

path: .spaces[1].metrics.loc.sloc
old: 3.0
new: 5.0

path: .spaces[1].metrics.loc.ploc
old: 3.0
new: 5.0

path: .spaces[1].metrics.mi.mi_visual_studio
old: 77.25220888286663
new: 70.45175244735273

path: .spaces[1].metrics.mi.mi_original
old: 132.10127718970193
new: 120.47249668497318

path: .spaces[1].metrics.mi.mi_sei
old: 114.98282536407302
new: 98.2060413983146

path: .spaces[1].metrics.nargs.average
old: 1.0
new: 4.0

path: .spaces[1].metrics.nargs.sum
old: 1.0
new: 4.0

path: .spaces[1].metrics.halstead.time
old: 13.453345183589487
new: 30.76676344041708

path: .spaces[1].metrics.halstead.N1
old: 11.0
new: 15.0

path: .spaces[1].metrics.halstead.N2
old: 5.0
new: 12.0

path: .spaces[1].metrics.halstead.effort
old: 242.1602133046108
new: 553.8017419275075

path: .spaces[1].metrics.halstead.length
old: 16.0
new: 27.0

path: .spaces[1].metrics.halstead.level
old: 0.22857142857142856
new: 0.1904761904761905

path: .spaces[1].metrics.halstead.purity_ratio
old: 1.7282177784002015
new: 1.616721646459379

path: .spaces[1].metrics.halstead.difficulty
old: 4.375
new: 5.25

path: .spaces[1].metrics.halstead.n2
old: 4.0
new: 8.0

path: .spaces[1].metrics.halstead.volume
old: 55.35090589819676
new: 105.48604608143

path: .spaces[1].metrics.halstead.vocabulary
old: 11.0
new: 15.0

path: .spaces[1].metrics.halstead.bugs
old: 0.012950323152584048
new: 0.022479239973047977

path: .spaces[1].metrics.halstead.estimated_program_length
old: 27.651484454403228
new: 43.65148445440323

path: .spaces[1].metrics.nexits.sum
old: 0.0
new: 1.0

path: .spaces[1].metrics.nexits.average
old: 0.0
new: 1.0

Code

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

Minimal test - lines (10, 46)

path: .spaces[0].metrics.nargs.average
old: 0.0
new: 3.0

path: .spaces[0].metrics.nargs.sum
old: 0.0
new: 3.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.sum
old: 1.0
new: 0.0

path: .spaces[0].metrics.nexits.average
old: 1.0
new: 0.0

path: .spaces[0].metrics.mi.mi_original
old: 114.98294647173871
new: 69.60907225703721

path: .spaces[0].metrics.mi.mi_visual_studio
old: 67.24148916475949
new: 40.70705979943697

path: .spaces[0].metrics.mi.mi_sei
old: 127.11796211110978
new: 50.73436639445175

path: .spaces[0].metrics.loc.lloc
old: 2.0
new: 47.0

path: .spaces[0].metrics.loc.blank
old: 0.0
new: 2.0

path: .spaces[0].metrics.loc.ploc
old: 5.0
new: 31.0

path: .spaces[0].metrics.loc.cloc
old: 2.0
new: 4.0

path: .spaces[0].metrics.loc.sloc
old: 7.0
new: 37.0

path: .spaces[0].metrics.cognitive.sum
old: 0.0
new: 5.0

path: .spaces[0].metrics.cognitive.average
old: 0.0
new: 5.0

path: .spaces[0].metrics.halstead.N1
old: 16.0
new: 237.0

path: .spaces[0].metrics.halstead.N2
old: 10.0
new: 86.0

path: .spaces[0].metrics.halstead.time
old: 33.210635585159004
new: 2829.0257253145237

path: .spaces[0].metrics.halstead.purity_ratio
old: 2.0203586543454155
new: 0.8595430377804778

path: .spaces[0].metrics.halstead.n2
old: 8.0
new: 35.0

path: .spaces[0].metrics.halstead.effort
old: 597.7914405328621
new: 50922.46305566143

path: .spaces[0].metrics.halstead.estimated_program_length
old: 52.529325012980806
new: 277.63240120309433

path: .spaces[0].metrics.halstead.n1
old: 9.0
new: 22.0

path: .spaces[0].metrics.halstead.bugs
old: 0.023654396566148563
new: 0.4579502985258259

path: .spaces[0].metrics.halstead.difficulty
old: 5.625
new: 27.02857142857143

path: .spaces[0].metrics.halstead.volume
old: 106.27403387250882
new: 1884.0234745752111

path: .spaces[0].metrics.halstead.level
old: 0.17777777777777778
new: 0.03699788583509514

path: .spaces[0].metrics.halstead.vocabulary
old: 17.0
new: 57.0

path: .spaces[0].metrics.halstead.length
old: 26.0
new: 323.0

Code

extern "C" void
invoke_copy_to_stack(uint64_t* d, uint32_t paramCount, nsXPTCVariant* s)
{
   for(; paramCount > 0; paramCount--, d++, s++)
    {
        if(s->IsIndirect())
        {
            *((void**)d) = &s->val;
            continue;
        }

        /*
         * AMD64 platform uses 8 bytes align.
         */

        switch(s->type)
        {
        case nsXPTType::T_I8     : *((int8_t*)  d) = s->val.i8;          break;
        case nsXPTType::T_I16    : *((int16_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;         break;
        case nsXPTType::T_U8     : *((uint8_t*) d) = s->val.u8;          break;
        case nsXPTType::T_U16    : *((uint16_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;         break;
        case nsXPTType::T_FLOAT  : *((float*)   d) = s->val.f;           break;
        case nsXPTType::T_DOUBLE : *((double*)  d) = s->val.d;           break;
        case nsXPTType::T_BOOL   : *((bool*)  d) = s->val.b;           break;
        case nsXPTType::T_CHAR   : *((char*)    d) = s->val.c;           break;
        case nsXPTType::T_WCHAR  : *((wchar_t*) d) = s->val.wc;          break;
        default:
            // all the others are plain pointer types
            *((void**)d) = s->val.p;
            break;
        }
    }
}