3 ms·
The problem with cyclomatic complexity measurements, is that if you take two similar pieces of code, one with error handling for all potential failures, and one
by StillBored 12y ago
The problem with cyclomatic complexity measurements, is that if you take two similar pieces of code, one with error handling for all potential failures, and one with absolutely no errors handling you get a large variation in the resulting complexity metric. Both pieces of code will probably pass simple correctness tests. But you can't really even make a statement about which is more robust, as the code with all the error handling paths may be full of latent bugs of worse severity than (another thing hard to quantify) simply not handling the errors.
So, when people start talking about the cyclomatic complexity, it seems to me that we are better off understanding we are deep into a philosophical discussion rather than a scientific one.
- bediger4000 12y agoCyclomatic complexity may just be another way of saying "lines of code": (http://www.scirp.org/journal/PaperDownload.aspx?paperID=779 http://www.scirp.org/journal/PaperDownload.aspx?paperID=779) We found that due mostly to issues regarding population variance, that the linearity of the relationship between these two measurements has been severely un-derestimated. Using modern statistical tools we develop linear models that can account for the majority of CC by LOC alone. We conclude that CC has no explanatory power of its own and that LOC and CC measure the same property. We also conclude that if CC does have any validity as a measure of either complexity or test space size, then we must conclude these factors grow linearly with size regardless of software language, paradigm, or methodology. I was looking for another reference, and I found this one, which seems far better researched.
- deleted 12y ago[deleted]