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?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
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. :)
Instability is supported in various code metric tools.