This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-11-21
Channels
- # announcements (10)
- # aws (10)
- # babashka (23)
- # beginners (111)
- # biff (8)
- # calva (25)
- # clj-kondo (9)
- # cljsrn (4)
- # clojure (72)
- # clojure-belgium (6)
- # clojure-europe (50)
- # clojure-germany (2)
- # clojure-nl (1)
- # clojure-norway (6)
- # clojure-uk (1)
- # datahike (3)
- # emacs (10)
- # graalvm (19)
- # graphql (3)
- # juxt (7)
- # kaocha (9)
- # malli (23)
- # nbb (20)
- # pathom (17)
- # pedestal (6)
- # polylith (11)
- # portal (8)
- # remote-jobs (3)
- # shadow-cljs (18)
- # sql (3)
- # tools-deps (20)
Hi. Is there a Clojure utility (or clj-kondo feature) that calculates "cognitive complexity"? there's something similiar in Rust lang that made me think https://rust-lang.github.io/rust-clippy/master/index.html#cognitive_complexity
any other utility that does something like this in the ecosystem? does even make sense since clojure code tends to be more "condensed" ?
so it’s just cyclomatic complexity? (the past names referred to in that page suggests so)
i guess? i too remember there are multiple naming for something like this. i remember in python there was a tool that checks how nested your code is
i'm not even sure it makes sense in clojure due to scenarios like comp f g h
and map
of filter
and threading etc etc
afaict composition doesn’t increase the complexity as it measures the number of different execution paths that are possible
found some pretty ancient code https://github.com/lokori/uncomplexor/blob/master/src/leiningen/uncomplexor.clj it should be doable to make a calculation like that with clj-kondo and issue a warning if a certain threshold is exceeded
According to https://ask.clojure.org/index.php/11627/the-pipe-char-considered-valid-symbol-constituent-character, and re-verified by @alexmiller moments ago in thread linked below, a pipe char |
is not valid as an identifier char even though the parser will accept it. It reserved for future use at the language level. I think clj-kondo should report it as an error.
:foo|bar ; invalid
foo|bar ; invalid
https://clojurians.slack.com/archives/CBE668G4R/p1669064417292719?thread_ts=1669063722.432239&cid=CBE668G4R