TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

McCabe's Cyclomatic Complexity and Why We Don't Use It (2014)

12 pointsby jcrover 9 years ago

3 comments

gtrevorjayover 9 years ago
Been there. Did not get the t-shirt, but I did perform a [large empirical study][1] on McCabe&#x27;s. It turns out that once you account for hetero-scedasticity it gives almost no more information than lines of code. Whether that reflects more on McCabe&#x27;s or the average programming style, I (still) leave as an exercise to the reader.<p>[1]: <a href="http:&#x2F;&#x2F;www.scirp.org&#x2F;journal&#x2F;PaperInformation.aspx?PaperID=779" rel="nofollow">http:&#x2F;&#x2F;www.scirp.org&#x2F;journal&#x2F;PaperInformation.aspx?PaperID=7...</a> &quot;Cyclomatic Complexity and Lines of Code: Empirical Evidence of a Stable Linear Relationship&quot;
keithnoizuover 9 years ago
CC by itself isn&#x27;t all that useful but C.R.A.P index can come in pretty handing for identifying under tested code even if the occasional, and usually unnecessary, switch statement needs to be ignored.
评论 #11010263 未加载
nickpsecurityover 9 years ago
Good examples. The tools should come 2nd to humans wherever it makes sense. I push strong static analysis tools like Astree &amp; SPARK because they find things that are hard for humans. Complexity metrics, if well-designed, might find trouble spots in the code. However, I agree with author that this sort of thing is hard enough for a computer to understand that anyone using that should let human mind decide if a change makes sense for comprehension.<p>Preferably, several of them that are more likely to disagree. ;)
评论 #11010181 未加载