# Global Metrics

path: .metrics.nexits.average
old: 0.0
new: 1.0
path: .metrics.nexits.sum
old: 0.0
new: 1.0
path: .metrics.nargs.sum
old: 0.0
new: 3.0
path: .metrics.nargs.average
old: 0.0
new: 3.0
path: .metrics.cyclomatic.average
old: 1.0
new: 9.5
path: .metrics.cyclomatic.sum
old: 2.0
new: 19.0
path: .metrics.loc.cloc
old: 4.0
new: 63.0
path: .metrics.loc.blank
old: 0.0
new: 56.0
path: .metrics.loc.ploc
old: 3.0
new: 75.0
path: .metrics.loc.sloc
old: 7.0
new: 194.0
path: .metrics.loc.lloc
old: 0.0
new: 59.0
path: .metrics.cognitive.average
old: 0.0
new: 8.0
path: .metrics.cognitive.sum
old: 0.0
new: 8.0
path: .metrics.mi.mi_visual_studio
old: 68.12069433517908
new: 23.01175340426367
path: .metrics.mi.mi_original
old: 116.48638731315624
new: 39.35009832129087
path: .metrics.mi.mi_sei
old: 138.61569396244263
new: 21.63073099396029
path: .metrics.halstead.length
old: 20.0
new: 477.0
path: .metrics.halstead.time
old: 19.741840336594983
new: 4930.000479478899
path: .metrics.halstead.vocabulary
old: 14.0
new: 102.0
path: .metrics.halstead.effort
old: 355.35312605870973
new: 88740.00863062018
path: .metrics.halstead.purity_ratio
old: 1.975488750216347
new: 1.2516853746192471
path: .metrics.halstead.n2
old: 6.0
new: 76.0
path: .metrics.halstead.bugs
old: 0.01672317901799221
new: 0.6631702819914131
path: .metrics.halstead.estimated_program_length
old: 39.50977500432694
new: 597.0539236933809
path: .metrics.halstead.N2
old: 7.0
new: 163.0
path: .metrics.halstead.difficulty
old: 4.666666666666667
new: 27.88157894736842
path: .metrics.halstead.N1
old: 13.0
new: 314.0
path: .metrics.halstead.level
old: 0.21428571428571427
new: 0.03586597451628126
path: .metrics.halstead.n1
old: 8.0
new: 26.0
path: .metrics.halstead.volume
old: 76.14709844115208
new: 3182.746888120403

# Spaces Data

## Minimal test - lines (27, 83)

path: .spaces[0].metrics.halstead.effort
old: 355.35312605870973
new: 79159.01934132367
path: .spaces[0].metrics.halstead.level
old: 0.21428571428571427
new: 0.03567447045707915
path: .spaces[0].metrics.halstead.time
old: 19.741840336594983
new: 4397.723296740204
path: .spaces[0].metrics.halstead.n1
old: 8.0
new: 26.0
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.975488750216347
new: 1.1637044429233756
path: .spaces[0].metrics.halstead.N1
old: 13.0
new: 297.0
path: .spaces[0].metrics.halstead.bugs
old: 0.01672317901799221
new: 0.6145336693026984
path: .spaces[0].metrics.halstead.estimated_program_length
old: 39.50977500432694
new: 506.2114326716684
path: .spaces[0].metrics.halstead.N2
old: 7.0
new: 138.0
path: .spaces[0].metrics.halstead.length
old: 20.0
new: 435.0
path: .spaces[0].metrics.halstead.n2
old: 6.0
new: 64.0
path: .spaces[0].metrics.halstead.difficulty
old: 4.666666666666667
new: 28.03125
path: .spaces[0].metrics.halstead.volume
old: 76.14709844115208
new: 2823.9560969034087
path: .spaces[0].metrics.halstead.vocabulary
old: 14.0
new: 90.0
path: .spaces[0].metrics.nargs.sum
old: 0.0
new: 3.0
path: .spaces[0].metrics.nargs.average
old: 0.0
new: 3.0
path: .spaces[0].metrics.cognitive.average
old: 0.0
new: 8.0
path: .spaces[0].metrics.cognitive.sum
old: 0.0
new: 8.0
path: .spaces[0].metrics.cyclomatic.sum
old: 1.0
new: 18.0
path: .spaces[0].metrics.cyclomatic.average
old: 1.0
new: 18.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.loc.blank
old: 0.0
new: 9.0
path: .spaces[0].metrics.loc.ploc
old: 3.0
new: 47.0
path: .spaces[0].metrics.loc.cloc
old: 4.0
new: 1.0
path: .spaces[0].metrics.loc.sloc
old: 7.0
new: 57.0
path: .spaces[0].metrics.loc.lloc
old: 0.0
new: 56.0
path: .spaces[0].metrics.mi.mi_visual_studio
old: 68.2551972591557
new: 35.11340373702712
path: .spaces[0].metrics.mi.mi_original
old: 116.71638731315625
new: 60.04392039031637
path: .spaces[0].metrics.mi.mi_sei
old: 138.84569396244265
new: 22.944908123794548

### Code

    PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, 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
            switch(type)
            {
            case nsXPTType::T_I8     : dp->val.i8  = *((int8_t*)  ap);       break;
            case nsXPTType::T_I16    : dp->val.i16 = *((int16_t*) ap);       break;
            case nsXPTType::T_I32    : dp->val.i32 = *((int32_t*) ap);       break;
            case nsXPTType::T_I64    : dp->val.i64 = *((int64_t*) ap); ap++; break;
            case nsXPTType::T_U8     : dp->val.u8  = *((uint8_t*) ap);       break;
            case nsXPTType::T_U16    : dp->val.u16 = *((uint16_t*)ap);       break;
            case nsXPTType::T_U32    : dp->val.u32 = *((uint32_t*)ap);       break;
            case nsXPTType::T_U64    : dp->val.u64 = *((uint64_t*)ap); ap++; break;
            case nsXPTType::T_FLOAT  : dp->val.f   = *((float*)   ap);       break;
            case nsXPTType::T_DOUBLE : dp->val.d   = *((double*)  ap); ap++; break;
            case nsXPTType::T_BOOL   : dp->val.b   = *((bool*)  ap);       break;
            case nsXPTType::T_CHAR   : dp->val.c   = *((char*)    ap);       break;
            case nsXPTType::T_WCHAR  : dp->val.wc  = *((wchar_t*) ap);       break;
            default:
                NS_ERROR("bad type");
                break;
            }
        }

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

        return result;
    }