Implement Message Passing Coupling metric
Brought to you by:
sauerf
From metrics.netbeans.org:
* MPC, or Message Passing Coupling, is defined as
the sum of the number of method calls made by all
methods in a class. Like RFC and CBO, MPC is a measure
of a class' complexity. Classes with high MPC metrics
may be doing too much work, and should be split into
smaller, more narrowly focused classes.
Logged In: YES
user_id=52904
I assume this means number of unique *external* method
calls. This one is doable in a reasonable amount of
computational time. RFC is not as you can imagine,
recursing over the entire call graph will take forever, and it will
also require that type bindings be resolved when the AST is
created wich will also dramatically slow things down.
Logged In: YES
user_id=374411
No, I mean all method calls, including methods in the
current class. Otherwise, it's just another metric weighted
to measure coupling between classes. Instead, it should be a
measure of the intrinsic complexity of the class.
As far as I can understand, RFC is a two-level recursion
(all external methods called plus all methods called by
those), it doesn't involve recursing over the whole graph.
Logged In: YES
user_id=52599
Isn't this metric somewhat misleading? For example, if i
refactor
if (x1 < x2)
x3 = x1;
else
x3 = x2;
to
x3 = Math.min(x1, x2);
the metric would increase, although it seems to me as if
complexity of the class got decreased?