Sunday, January 11, 2009

Cyclomatic complexity - class vs method level? Chidamber & K

Cyclomatic complexity is useful to look at the method level. At the class level it mayb e useful to look at the sum of CC's of all the methods in the class - this is a different measure referred to as Weighted Method per Class.

This is a good article that looks at cyclomatic complexity of methods in a codebase developed using TDD approach.

This article looks at the correlation between defects and complexity measures.

The Chidamber & Kemerer metrics are worth taking a look at:
- WMC: Weighted methods per class
- DIT: Depth of Inheritance Tree
- NOC: Number of Children
- CBO: Coupling between object classes
- RFC: Response for a Class
- LCOM: Lack of cohesion in methods

No comments:

Post a Comment