4 ms·
Switches seem to increase the metrics for cyclomatic complexity absurdly in all of the tools I've used to measure it, compared to directly equivalent constructi
by douche 10y ago
Switches seem to increase the metrics for cyclomatic complexity absurdly in all of the tools I've used to measure it, compared to directly equivalent constructions, like a raft of else-ifs or indexing into a lookup dictionary. Things like a simple mapping between two slightly incompatible enums will have whopping cyclomatic scores, despite being incredibly simple to reason about. Taking that kind of a metric to heart can lead to a different flavor of cargo-culting.