These are chat archives for ramda/ramda

12th
Dec 2014
Jethro Larson
@jethrolarson
Dec 12 2014 20:57

Ran a complexity analysis on some code I converted to using ramda. I feel like I'm cheating.

Before:

Logical LOC: 12
Mean parameter count: 1
Cyclomatic complexity: 4
Cyclomatic complexity density: 33%
Maintainability index: 104

After:

Logical LOC: 3
Mean parameter count: 0
Cyclomatic complexity: 1
Cyclomatic complexity density: 33%
Maintainability index: 130
Obv the static analysis can't figure out that the functions still have parameters
David Chambers
@davidchambers
Dec 12 2014 21:46
I've had similarly amusing results with coverage tools. Apparently some of my modules have zero logic branches. ;)
Jethro Larson
@jethrolarson
Dec 12 2014 21:47
Kind of feels like you need to add some additional configuration for these analyzers so they can count certain functions as adding complexity.
ifElse(pred, foo, bar) is only slightly less complex than if(){}else{}
David Chambers
@davidchambers
Dec 12 2014 21:48
Yes, though there is value in pushing the complexity down into libraries, so the numbers aren't totally farcical.
Jethro Larson
@jethrolarson
Dec 12 2014 21:52
Yeah, ramda is kind of creating it's own version of js, and I think we have to measure what we write with it somehow
i like that name