No, there is no way to prevent VS Code Analysis from inspecting a subset of statements in a method. If you do not want to fix the violations generated by these statements, your best bet might be to add suppressions with a standardized justification that allows you to easily identify them later if necessary. e.g.:
[SuppressMessage("Some.Category", "CA9999:SomeRule",
Justification = "Boilerplate code ignored under departmental policy.")]
That said, my own preference would generally be to clean these up rather than hide them, but ymmv...