When You Should Ignore Metrics
Our team has been doing a bang up job of reducing our complexity through our hit list (All of our methods are ranked by Flog score and we spend some part of every iteration picking the worst methods and trying to refactor them.). But sometimes we run into a situation where we prefer a high Flog score to a low one. For instance, this bit 'o code: def is_something?(x, y) x.foo == y.foo && x.bar == y.bar && x.blah == y.blah && # and 10 more lines of the same end which had a Flog score in the 60s. We could have changed it to this: def is_something?(x, y) ["foo", "bar", "blah", # and so on ].inject(true) do | a, b | a && x.send(b) == y.send(b) end end Which gave a us a much lower score. However that first method is crazy simple. Merely glance at it and you know what it's doing. The 'less complex' method? Even an experienced ruby dev would need a moment or two. As for a new dev... I can remem...