There are some rules that generate false positives for our own use cases although the one I have in mind should apply to a wider range of people. We mark these issues as “won’t fix” but they keep popping and I want a general solution that will automate this manual labor.
Hence the need to ignore some blocks of code for just a concrete rule. All other rules should still run for these blocks of code. I imagine this to be an addition to the already present feature of generally ignoring blocks of code that match certain patterns – besides the two inputs to match the beginning and end of a block of code, a new one can be added to list the rules to be ignored.
Alternatively, you can introduce a tool to build criteria to automatically resolve issues as “won’t fix”.
Our use case for this: the rule scanning for dereferencing null pointers in Java is based on the
@Nullable annotation. However, then using the key holder interface to get the auto-generated, we are pretty sure it won’t return null as all tables have autogenerated key.