计算Clojure函数的圈复杂度的合理方法是什么?根据 if和 cond之类的函数来计算决策点很容易,但是使用宏开始变得棘手。有人尝试过使用Clojure或其他功能语言吗?
What would be a reasonable way to calculate the cyclomatic complexity of a Clojure function? It's easy to count decision points based on functions like 'if' and 'cond', but it starts to get tricky with macros. Anyone has tried this for Clojure or maybe another functional language?
推荐答案宏是一种抽象,不应该用于CC计算,
Macros are an abstraction and should not contributed to the CC calculation, any more than a function call would.
话虽如此,我认为CC对Clojure并不是特别有趣。我对测量过度使用可变性的东西更感兴趣。
That said, I don't think that CC is particularly interesting for Clojure. I would be more interested in something that measured overuse of mutability.
更多推荐
如何计算Clojure函数的圈复杂度?
发布评论