5. Which code is good
• Metrics does exists to
understand fitness of your code
• Various tools exists which helps
to analyze it
6. Technical debt
..is extra development work that arises when
code that is easy to implement in the short
run is used instead of applying the best
overall solution.
10. Chidamber & Kemerer object-oriented
metrics
Shyam R. Chidamber
Chris F. Kemerer
http://faculty.salisbury.edu/~stlauterburg/cosc425/
metricforood_chidamberkemerer94.pdf
11. Chidamber & Kemerer object-oriented
metrics
Name Description
DIT Depth of inheritance tree
NOC Number of children
NPM Number of public methods
RFC Response for class - # of methods executed
due to method call
CE Efferent coupling - # of other classes this
class uses (outgoing calls)
CA Afferent coupling - how many other classes
use this class (incoming calls)
WMC Weighted methods/class
∑ of cyclomatic complexity
12. Limitations of metrics
• no “1 True Metric”
• gathered but ignored
• inaction / overaction
• signal to noise prefer trends to discrete values
For example, the following simple Java code snippet is reported with complexity 2 by the Eclipse Metrics Plugin, with 4 by GMetrics, and with complexity 5 by SonarQube: