Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Size by itself is very elusive metric and varies hugely depending on the language used. At least for a single method/procedure I found Cyclomatic Complexity (http://en.wikipedia.org/wiki/Cyclomatic_complexity) to be best predictor of maintainability if not quality


The metrics involved here are specifically OO metrics - inheritance depth, number of children and so on, but there's at least one, Weighted Method Count, which uses cyclomatic complexity as a weighting factor. It's described on page 7 of the paper.

It seems counter-intuitive to me too (that the complexity of a method doesn't matter), but perhaps if you have to have that complexity in your application, it's best to have it in one method rather than trying to spread it around with inheritance or some sort of pattern?


It is a result of the paper that once you control for lines of code, Cylomatic Complexity no longer predicts defect rate.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: