# Global Metrics

path: .metrics.halstead.level
old: 0.009226696918131973
new: 0.04072398190045248
path: .metrics.halstead.N2
old: 615.0
new: 136.0
path: .metrics.halstead.time
old: 71986.40266875018
new: 2941.749292772373
path: .metrics.halstead.vocabulary
old: 165.0
new: 98.0
path: .metrics.halstead.effort
old: 1295755.248037503
new: 52951.48726990271
path: .metrics.halstead.bugs
old: 3.961813822986395
new: 0.4700357100048847
path: .metrics.halstead.length
old: 1623.0
new: 326.0
path: .metrics.halstead.difficulty
old: 108.3811475409836
new: 24.555555555555557
path: .metrics.halstead.N1
old: 1008.0
new: 190.0
path: .metrics.halstead.purity_ratio
old: 0.6647438937984365
new: 1.737564517716303
path: .metrics.halstead.volume
old: 11955.54095372096
new: 2156.395409181558
path: .metrics.halstead.n1
old: 43.0
new: 26.0
path: .metrics.halstead.estimated_program_length
old: 1078.8793396348624
new: 566.4460327755148
path: .metrics.halstead.n2
old: 122.0
new: 72.0
path: .metrics.cyclomatic.average
old: 7.615384615384615
new: 4.5
path: .metrics.cyclomatic.sum
old: 99.0
new: 9.0
path: .metrics.mi.mi_sei
old: -36.78538323875866
new: 16.90277742027929
path: .metrics.mi.mi_visual_studio
old: 1.611626994410027
new: 29.18854012744476
path: .metrics.mi.mi_original
old: 2.7558821604411463
new: 49.912403617930536
path: .metrics.nargs.average
old: 2.25
new: 3.0
path: .metrics.nargs.sum
old: 27.0
new: 3.0
path: .metrics.nexits.average
old: 3.25
new: 1.0
path: .metrics.nexits.sum
old: 39.0
new: 1.0
path: .metrics.loc.cloc
old: 44.0
new: 9.0
path: .metrics.loc.ploc
old: 323.0
new: 72.0
path: .metrics.loc.lloc
old: 186.0
new: 28.0
path: .metrics.loc.sloc
old: 390.0
new: 132.0
path: .metrics.loc.blank
old: 23.0
new: 51.0
path: .metrics.nom.functions
old: 12.0
new: 1.0
path: .metrics.nom.total
old: 12.0
new: 1.0
path: .metrics.cognitive.average
old: 9.666666666666666
new: 8.0
path: .metrics.cognitive.sum
old: 116.0
new: 8.0

# Spaces Data

## Minimal test - lines (13, 59)

path: .spaces[0].metrics.mi.mi_visual_studio
old: 56.34484248823963
new: 40.04924827721146
path: .spaces[0].metrics.mi.mi_sei
old: 90.50936353231413
new: 35.11828371572115
path: .spaces[0].metrics.mi.mi_original
old: 96.34968065488977
new: 68.4842145540316
path: .spaces[0].metrics.cyclomatic.sum
old: 4.0
new: 8.0
path: .spaces[0].metrics.cyclomatic.average
old: 4.0
new: 8.0
path: .spaces[0].metrics.nargs.average
old: 1.0
new: 3.0
path: .spaces[0].metrics.nargs.sum
old: 1.0
new: 3.0
path: .spaces[0].metrics.cognitive.average
old: 3.0
new: 8.0
path: .spaces[0].metrics.cognitive.sum
old: 3.0
new: 8.0
path: .spaces[0].metrics.halstead.length
old: 68.0
new: 258.0
path: .spaces[0].metrics.halstead.volume
old: 311.77745004903863
new: 1581.3550183718014
path: .spaces[0].metrics.halstead.effort
old: 3165.7402620363923
new: 42984.10459028806
path: .spaces[0].metrics.halstead.n1
old: 11.0
new: 26.0
path: .spaces[0].metrics.halstead.N2
old: 24.0
new: 92.0
path: .spaces[0].metrics.halstead.n2
old: 13.0
new: 44.0
path: .spaces[0].metrics.halstead.bugs
old: 0.07186690328742805
new: 0.40902576742364855
path: .spaces[0].metrics.halstead.time
old: 175.8744590020218
new: 2388.005810571559
path: .spaces[0].metrics.halstead.difficulty
old: 10.153846153846152
new: 27.181818181818183
path: .spaces[0].metrics.halstead.N1
old: 44.0
new: 166.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.2670509432477126
new: 1.4047535809756182
path: .spaces[0].metrics.halstead.vocabulary
old: 24.0
new: 70.0
path: .spaces[0].metrics.halstead.estimated_program_length
old: 86.15946414084446
new: 362.4264238917095
path: .spaces[0].metrics.halstead.level
old: 0.0984848484848485
new: 0.03678929765886287
path: .spaces[0].metrics.loc.blank
old: 0.0
new: 9.0
path: .spaces[0].metrics.loc.lloc
old: 8.0
new: 26.0
path: .spaces[0].metrics.loc.cloc
old: 2.0
new: 1.0
path: .spaces[0].metrics.loc.ploc
old: 13.0
new: 37.0
path: .spaces[0].metrics.loc.sloc
old: 15.0
new: 47.0

### Code

    __attribute__ ((regparm (3)))
    PrepareAndDispatch(uint32_t methodIndex, nsXPTCStubBase* self, uint32_t* args)
    {

        nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
        const nsXPTMethodInfo* info;
        uint8_t paramCount;
        uint8_t i;

        NS_ASSERTION(self,"no self");

        self->mEntry->GetMethodInfo(uint16_t(methodIndex), &info);
        paramCount = info->GetParamCount();

        const uint8_t indexOfJSContext = info->IndexOfJSContext();

        uint32_t* ap = args;
        for(i = 0; i < paramCount; i++, ap++)
        {
            const nsXPTParamInfo& param = info->GetParam(i);
            const nsXPTType& type = param.GetType();
            nsXPTCMiniVariant* dp = ¶mBuffer[i];

            if (i == indexOfJSContext)
                ap++;

            if(param.IsOut() || !type.IsArithmetic())
            {
                dp->val.p = (void*) *ap;
                continue;
            }
            // else
    	    dp->val.p = (void*) *ap;
            switch(type)
            {
            case nsXPTType::T_I64    : dp->val.i64 = *((int64_t*) ap); ap++; break;
            case nsXPTType::T_U64    : dp->val.u64 = *((uint64_t*)ap); ap++; break;
            case nsXPTType::T_DOUBLE : dp->val.d   = *((double*)  ap); ap++; break;
            default                  : break;
            }
        }

        nsresult result = self->mOuter->CallMethod((uint16_t)methodIndex, info,
                                                   paramBuffer);

        return result;
    }