Hacker News new | ask | show | jobs
by zelos 1682 days ago
Goodhart's law in effect.

I once had a job where a portion of our bonus was related to an automated code quality score. Needless to say, we reverse engineered the algorithm and scripted the (pointless, probably slightly harmful) changes to the source to maximise the score.

1 comments

What did and didn't the score algorithm like?

(Did you reverse eng it during work time :-))

There were several components, but the parts that were I can remember were gamed were code duplication - someone figured out the minimum number of matching lines required for it to be detected and made minor changes in the middle of blocks - and number of imports. The penalty for .* imports was quite low, so we just ended up with wildcard imports everywhere.
Ok :-) I'm surprised they were looking for duplicated code, interesting