https://en.wikipedia.org/wiki/Goodhart%27s_law
My favorite story related to this, because the managers thought LoC would be a good measure of productivity, is "-2000 lines of code": https://www.folklore.org/StoryView.py?story=Negative_2000_Li...