Global Metrics

path: .metrics.nargs.average
old: 1.0
new: 3.0

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

path: .metrics.halstead.length
old: 28.0
new: 646.0

path: .metrics.halstead.difficulty
old: 3.3333333333333335
new: 27.327956989247312

path: .metrics.halstead.estimated_program_length
old: 27.11941547876375
new: 712.1836944223581

path: .metrics.halstead.n2
old: 6.0
new: 93.0

path: .metrics.halstead.vocabulary
old: 11.0
new: 116.0

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

path: .metrics.halstead.N2
old: 8.0
new: 221.0

path: .metrics.halstead.N1
old: 20.0
new: 425.0

path: .metrics.halstead.bugs
old: 0.015688199256260874
new: 0.8157731100589903

path: .metrics.halstead.purity_ratio
old: 0.9685505528129912
new: 1.1024515393534955

path: .metrics.halstead.time
old: 17.937793578119322
new: 6726.102102526525

path: .metrics.halstead.level
old: 0.3
new: 0.0365925634467834

path: .metrics.halstead.volume
old: 96.86408532184431
new: 4430.255722852411

path: .metrics.halstead.effort
old: 322.8802844061478
new: 121069.83784547744

path: .metrics.cyclomatic.sum
old: 2.0
new: 36.0

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

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

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

path: .metrics.loc.sloc
old: 12.0
new: 183.0

path: .metrics.loc.ploc
old: 10.0
new: 141.0

path: .metrics.loc.blank
old: 2.0
new: 0.0

path: .metrics.loc.cloc
old: 0.0
new: 58.0

path: .metrics.loc.lloc
old: 4.0
new: 94.0

path: .metrics.nexits.sum
old: 1.0
new: 2.0

path: .metrics.nexits.average
old: 1.0
new: 0.6666666666666666

path: .metrics.nom.functions
old: 1.0
new: 3.0

path: .metrics.nom.total
old: 1.0
new: 3.0

path: .metrics.mi.mi_sei
old: 78.15457976937348
new: 16.263020276184754

path: .metrics.mi.mi_original
old: 106.5033064422955
new: 34.6660188735346

path: .metrics.mi.mi_visual_studio
old: 62.28263534637163
new: 20.272525657037775

Spaces Data

Minimal test - lines (12, 59)

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.cyclomatic.average
old: 1.0
new: 16.0

path: .spaces[0].metrics.cyclomatic.sum
old: 1.0
new: 16.0

path: .spaces[0].metrics.halstead.difficulty
old: 2.5
new: 19.17391304347826

path: .spaces[0].metrics.halstead.N1
old: 12.0
new: 108.0

path: .spaces[0].metrics.halstead.effort
old: 155.67442283867837
new: 15701.800068385097

path: .spaces[0].metrics.halstead.volume
old: 62.26976913547135
new: 818.9147427955946

path: .spaces[0].metrics.halstead.level
old: 0.4
new: 0.05215419501133787

path: .spaces[0].metrics.halstead.n1
old: 5.0
new: 21.0

path: .spaces[0].metrics.halstead.time
old: 8.648579046593243
new: 872.3222260213943

path: .spaces[0].metrics.halstead.vocabulary
old: 11.0
new: 44.0

path: .spaces[0].metrics.halstead.bugs
old: 0.009646214643915437
new: 0.20901544258452967

path: .spaces[0].metrics.halstead.N2
old: 6.0
new: 42.0

path: .spaces[0].metrics.halstead.length
old: 18.0
new: 150.0

path: .spaces[0].metrics.halstead.n2
old: 6.0
new: 23.0

path: .spaces[0].metrics.halstead.estimated_program_length
old: 27.11941547876375
new: 196.28059086766527

path: .spaces[0].metrics.halstead.purity_ratio
old: 1.5066341932646528
new: 1.3085372724511015

path: .spaces[0].metrics.mi.mi_visual_studio
old: 68.8670058865591
new: 40.77488171404499

path: .spaces[0].metrics.mi.mi_original
old: 117.76258006601606
new: 69.72504773101693

path: .spaces[0].metrics.mi.mi_sei
old: 94.29645813092256
new: 37.60764938082946

path: .spaces[0].metrics.loc.lloc
old: 4.0
new: 36.0

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

path: .spaces[0].metrics.loc.ploc
old: 7.0
new: 47.0

path: .spaces[0].metrics.loc.cloc
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

static uint32_t
invoke_count_words(uint32_t paramCount, nsXPTCVariant* s)
{
    uint32_t result = 0;
    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;
}