Is there a metric analogous to the McCabe Complexity measure to measure how cohesive a routine is and also how loosely (or tightly) coupled the routine is to other code in the same code base?
I think the metric you are looking for is LCOM4, although it applies more to classes.
Sonar explains it nicely here:
It's a great tool, if you can use it. :)
|show 1 more comment|
Instability is supported in various code metric tools.