Global Metrics
path: .metrics.nexits.average
old: 0.5
new: 1.0
path: .metrics.nexits.sum
old: 1.0
new: 2.0
path: .metrics.cognitive.average
old: 0.0
new: 10.0
path: .metrics.cognitive.sum
old: 0.0
new: 20.0
path: .metrics.cyclomatic.average
old: 1.0
new: 9.5
path: .metrics.cyclomatic.sum
old: 5.0
new: 38.0
path: .metrics.nargs.average
old: 0.0
new: 2.5
path: .metrics.nargs.sum
old: 0.0
new: 5.0
path: .metrics.halstead.bugs
old: 0.168837095146325
new: 0.9245968443192608
path: .metrics.halstead.level
old: 0.11071428571428572
new: 0.02423411065386374
path: .metrics.halstead.n1
old: 14.0
new: 27.0
path: .metrics.halstead.n2
old: 62.0
new: 53.0
path: .metrics.halstead.length
old: 202.0
new: 560.0
path: .metrics.halstead.difficulty
old: 9.03225806451613
new: 41.264150943396224
path: .metrics.halstead.time
old: 633.3024734056795
new: 8115.92429388936
path: .metrics.halstead.effort
old: 11399.444521302232
new: 146086.63729000848
path: .metrics.halstead.N1
old: 122.0
new: 398.0
path: .metrics.halstead.estimated_program_length
old: 422.46314015279273
new: 431.9617466502632
path: .metrics.halstead.N2
old: 80.0
new: 162.0
path: .metrics.halstead.purity_ratio
old: 2.0914016839247167
new: 0.77136026187547
path: .metrics.halstead.vocabulary
old: 76.0
new: 80.0
path: .metrics.halstead.volume
old: 1262.081357715604
new: 3540.279733136923
path: .metrics.loc.sloc
old: 98.0
new: 127.0
path: .metrics.loc.blank
old: 20.0
new: 5.0
path: .metrics.loc.lloc
old: 1.0
new: 89.0
path: .metrics.loc.ploc
old: 58.0
new: 103.0
path: .metrics.loc.cloc
old: 20.0
new: 19.0
path: .metrics.mi.mi_original
old: 58.442835802325945
new: 41.289971876307646
path: .metrics.mi.mi_visual_studio
old: 34.17709696042453
new: 24.14618238380564
path: .metrics.mi.mi_sei
old: 41.32874548002847
new: 15.93674036200153
Spaces Data
Minimal test - lines (16, 66)
path: .spaces[0].metrics.loc.blank
old: 18.0
new: 0.0
path: .spaces[0].metrics.loc.lloc
old: 1.0
new: 38.0
path: .spaces[0].metrics.loc.cloc
old: 8.0
new: 4.0
path: .spaces[0].metrics.loc.sloc
old: 74.0
new: 51.0
path: .spaces[0].metrics.halstead.level
old: 0.10912698412698411
new: 0.045289855072463775
path: .spaces[0].metrics.halstead.purity_ratio
old: 1.9138028513023853
new: 1.3423068886199965
path: .spaces[0].metrics.halstead.bugs
old: 0.163461698723394
new: 0.247431049742375
path: .spaces[0].metrics.halstead.estimated_program_length
old: 371.27775315266274
new: 220.13832973367943
path: .spaces[0].metrics.halstead.n2
old: 55.0
new: 25.0
path: .spaces[0].metrics.halstead.length
old: 194.0
new: 164.0
path: .spaces[0].metrics.halstead.effort
old: 10859.401587017132
new: 20223.81941061139
path: .spaces[0].metrics.halstead.volume
old: 1185.053744614965
new: 915.9338501182696
path: .spaces[0].metrics.halstead.difficulty
old: 9.163636363636364
new: 22.08
path: .spaces[0].metrics.halstead.time
old: 603.3000881676185
new: 1123.545522811744
path: .spaces[0].metrics.halstead.N1
old: 122.0
new: 116.0
path: .spaces[0].metrics.halstead.n1
old: 14.0
new: 23.0
path: .spaces[0].metrics.halstead.vocabulary
old: 69.0
new: 48.0
path: .spaces[0].metrics.halstead.N2
old: 72.0
new: 48.0
path: .spaces[0].metrics.cyclomatic.sum
old: 4.0
new: 17.0
path: .spaces[0].metrics.cyclomatic.average
old: 1.0
new: 17.0
path: .spaces[0].metrics.nexits.average
old: 0.5
new: 1.0
path: .spaces[0].metrics.nargs.sum
old: 0.0
new: 2.0
path: .spaces[0].metrics.nargs.average
old: 0.0
new: 2.0
path: .spaces[0].metrics.cognitive.average
old: 0.0
new: 6.0
path: .spaces[0].metrics.cognitive.sum
old: 0.0
new: 6.0
path: .spaces[0].metrics.nom.functions
old: 2.0
new: 1.0
path: .spaces[0].metrics.nom.total
old: 2.0
new: 1.0
path: .spaces[0].metrics.mi.mi_sei
old: 40.77246153958162
new: 45.05224788284568
path: .spaces[0].metrics.mi.mi_original
old: 63.55091977553212
new: 67.93071519046657
path: .spaces[0].metrics.mi.mi_visual_studio
old: 37.16428057048662
new: 39.72556443886934
Code
extern "C" 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;
}
}
// nuts, I know there's a cooler way of doing this, but it's late
// now and it'll probably come to me in the morning.
if (result & 0x3) result += 4 - (result & 0x3); // ensure q-word alignment
return result;
}