When is It Okay to Turn off Static Analysis Guidance
Editorial Note: I originally wrote this post for the SubMain blog. You can check out the original here, at their site. While you’re there, download CodeIt.Right and give it a try.
The balance among types of feedback drives some weird interpersonal dynamics and balances. For instance, consider the rather trite (if effective) management technique of the “compliment sandwich.” Managers with a negative piece of feedback precede and follow that feedback with compliments. In that fashion, the compliments form the “bun.”
Different people and different groups have their preferences for how to handle this. While some might bend over backward for diplomacy others prefer environments where people hurl snipes at one another and simply consider it “passionate debate.” I have no interest arguing for any particular approach — only in pointing out the variety. As it turns out, we humans find this subject thorny.
To some extent, this complicated situation extends beyond human boundaries and into automated systems. While we might not take quite the same umbrage as we would with humans, we still get frustrated. If you doubt this, I challenge you to tell me that you have never yelled at a compiler because you were sure your code had no errors. I thought so.
So from this perspective, I can understand the frustration with static analysis feedback. Often, when you decide to enable a new static analysis engine or linting tool on a codebase, the feedback overwhelms. 28,326 issues the code can demoralize anyone. And so the temptation emerges to recoil from this feedback and turn off the tool.
But should you do this? I would argue that usually, you should not. But situations do exist when disabling a static analyzer makes sense. Today, I’ll walk through some examples of times you might suppress such a warning.