# Global Metrics

path: .metrics.halstead.n1
old: 27.0
new: 24.0
path: .metrics.halstead.time
old: 20153.517551510384
new: 6311.288400825265
path: .metrics.halstead.volume
old: 9907.874550463204
new: 3073.6794159863302
path: .metrics.halstead.level
old: 0.027312228429546864
new: 0.027056277056277056
path: .metrics.halstead.estimated_program_length
old: 1638.9945733341765
new: 392.231909506044
path: .metrics.halstead.vocabulary
old: 225.0
new: 74.0
path: .metrics.halstead.difficulty
old: 36.61363636363637
new: 36.96
path: .metrics.halstead.length
old: 1268.0
new: 495.0
path: .metrics.halstead.N2
old: 537.0
new: 154.0
path: .metrics.halstead.purity_ratio
old: 1.2925824710837357
new: 0.792387695971806
path: .metrics.halstead.N1
old: 731.0
new: 341.0
path: .metrics.halstead.n2
old: 198.0
new: 50.0
path: .metrics.halstead.bugs
old: 1.695486439443176
new: 0.781878190953455
path: .metrics.halstead.effort
old: 362763.3159271869
new: 113603.19121485476
path: .metrics.cognitive.sum
old: 17.0
new: 22.0
path: .metrics.cognitive.average
old: 0.7727272727272727
new: 7.333333333333333
path: .metrics.nom.total
old: 22.0
new: 3.0
path: .metrics.nom.functions
old: 21.0
new: 3.0
path: .metrics.nom.closures
old: 1.0
new: 0.0
path: .metrics.cyclomatic.sum
old: 43.0
new: 28.0
path: .metrics.cyclomatic.average
old: 1.8695652173913044
new: 7.0
path: .metrics.loc.sloc
old: 357.0
new: 99.0
path: .metrics.loc.cloc
old: 32.0
new: 11.0
path: .metrics.loc.lloc
old: 120.0
new: 73.0
path: .metrics.loc.ploc
old: 264.0
new: 76.0
path: .metrics.loc.blank
old: 61.0
new: 12.0
path: .metrics.nexits.average
old: 0.8181818181818182
new: 0.6666666666666666
path: .metrics.nexits.sum
old: 18.0
new: 2.0
path: .metrics.nargs.sum
old: 17.0
new: 9.0
path: .metrics.nargs.average
old: 0.7727272727272727
new: 3.0
path: .metrics.mi.mi_sei
old: -22.92086450539811
new: 21.60605987412585
path: .metrics.mi.mi_visual_studio
old: 10.552653604620431
new: 28.280572604068656
path: .metrics.mi.mi_original
old: 18.045037663900946
new: 48.3597791529574

# Spaces Data

## Minimal test - lines (16, 42)

path: .spaces[0].metrics.nargs.sum
old: 17.0
new: 2.0
path: .spaces[0].metrics.nargs.average
old: 0.7727272727272727
new: 2.0
path: .spaces[0].metrics.cyclomatic.sum
old: 42.0
new: 7.0
path: .spaces[0].metrics.cyclomatic.average
old: 1.9090909090909092
new: 7.0
path: .spaces[0].metrics.nom.closures
old: 1.0
new: 0.0
path: .spaces[0].metrics.nom.total
old: 22.0
new: 1.0
path: .spaces[0].metrics.nom.functions
old: 21.0
new: 1.0
path: .spaces[0].metrics.mi.mi_visual_studio
old: 11.326432632256182
new: 49.18928134626698
path: .spaces[0].metrics.mi.mi_sei
old: -22.5954961428243
new: 66.82499579985408
path: .spaces[0].metrics.mi.mi_original
old: 19.36819980115807
new: 84.11367110211654
path: .spaces[0].metrics.nexits.average
old: 0.8181818181818182
new: 1.0
path: .spaces[0].metrics.nexits.sum
old: 18.0
new: 1.0
path: .spaces[0].metrics.halstead.difficulty
old: 38.23783783783784
new: 23.884615384615383
path: .spaces[0].metrics.halstead.bugs
old: 1.7205945487814698
new: 0.16476833247696576
path: .spaces[0].metrics.halstead.N2
old: 524.0
new: 27.0
path: .spaces[0].metrics.halstead.effort
old: 370851.2063024485
new: 10989.868650181352
path: .spaces[0].metrics.halstead.length
old: 1255.0
new: 89.0
path: .spaces[0].metrics.halstead.time
old: 20602.844794580473
new: 610.5482583434084
path: .spaces[0].metrics.halstead.volume
old: 9698.540170476814
new: 460.12332512836576
path: .spaces[0].metrics.halstead.estimated_program_length
old: 1521.6875327539317
new: 152.14764132514549
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.2125000260987502
new: 1.7095240598330954
path: .spaces[0].metrics.halstead.n1
old: 27.0
new: 23.0
path: .spaces[0].metrics.halstead.vocabulary
old: 212.0
new: 36.0
path: .spaces[0].metrics.halstead.n2
old: 185.0
new: 13.0
path: .spaces[0].metrics.halstead.N1
old: 731.0
new: 62.0
path: .spaces[0].metrics.halstead.level
old: 0.026152106304778065
new: 0.04186795491143318
path: .spaces[0].metrics.cognitive.average
old: 0.7727272727272727
new: 8.0
path: .spaces[0].metrics.cognitive.sum
old: 17.0
new: 8.0
path: .spaces[0].metrics.loc.cloc
old: 26.0
new: 2.0
path: .spaces[0].metrics.loc.blank
old: 59.0
new: 2.0
path: .spaces[0].metrics.loc.ploc
old: 251.0
new: 23.0
path: .spaces[0].metrics.loc.lloc
old: 120.0
new: 14.0
path: .spaces[0].metrics.loc.sloc
old: 336.0
new: 27.0

### Code

    extern "C" uint32_t
    invoke_count_words(uint32_t paramCount, nsXPTCVariant* s)
    {
        // Count a word for a0 even though it's never stored or loaded
        // We do this only for alignment of register pairs.
        uint32_t result = 1;
        for (uint32_t i = 0; i < paramCount; i++, result++, s++)
        {
            if (s->IsIndirect())
                continue;

            switch(s->type)
            {
            case nsXPTType::T_I64    :
            case nsXPTType::T_U64    :
            case nsXPTType::T_DOUBLE :
    	    if (result & 1)
    		result++;
    	    result++;
    	    break;

            default:
                break;
            }
        }
        return (result + 1) & ~(uint32_t)1;
    }