9

In Ruby, there are several tools to calculate complexity of the code, for example the cyclomatic complexity, the ABC score or flog, as described here: http://blog.codeclimate.com/blog/2013/08/07/deciphering-ruby-code-metrics/

Are there similar tools calculate the complexity of functions and/or entire namespaces in clojure?

iGEL
  • 16,540
  • 11
  • 60
  • 74

1 Answers1

9

To expand on my previous answer to a similar question: Homoiconicity in Clojure makes it quite easy to calculate basic code complexity measures.

That said, I wouldn't bother. The biggest sources of complexity in beginner Clojure programs come from wrong things, not structurally complex things. For example, programmers coming from a language like Ruby that encourages unstructured mutation are likely to initially:

Interestingly, many of these mistakes might also be flagged by automatic analysis.

Community
  • 1
  • 1
Stuart Dabbs Halloway
  • 1,658
  • 12
  • 10