Compartilhar via


Code analysis rule set reference

When you configure legacy analysis for managed code projects in Visual Studio, you can choose from a list of built-in rule sets. Some rules are included in more than one of the built-in rule sets, for example, the Basic Correctness Rules rule set includes rules that are in the Managed Recommended Rules rule set.

Note

The rule sets in this section pertain to legacy analysis. For information about rule sets available for code analyzer packages, see Use rule sets with code analyzers.

You can either use one of these built-in rule sets, or you can customize a rule set to fit your project requirements. If you include multiple rule sets that contain the same rule in a custom rule set, that rule only appears once in the custom rule set.

The topics in this section describe the built-in rule sets and the rules (or warnings) they contain.

Rule set Included rules
All Rules Contains all available managed and C++ rules
Basic Correctness Rules Includes Managed Recommended Rules plus rules for logic errors and framework usage
Extended Correctness Rules Includes Basic Correctness Rules (which includes Managed Recommended Rules) plus more rules for logic errors and framework usage
Basic Design Guideline Rules Includes Managed Recommended Rules plus rules for ensuring code is easy to read, understand, and maintain
Extended Design Guidelines Rules Includes Basic Design Guideline Rules (which includes Managed Recommended Rules) plus more maintainability rules that focus on naming
Globalization Rules Includes rules for globalization problems
Managed Minimum Rules Includes four rules for critical managed code problems
Managed Recommended Rules Includes Managed Minimum Rules plus more rules for critical managed code problems
Mixed Minimum Rules Includes rules for critical problems in C++ code for CLR
Mixed Recommended Rules Includes Mixed Minimum Rules plus more rules for critical problems in C++ code for CLR
Native Minimum Rules Includes rules for critical problems in native code
Native Recommended Rules Includes Native Minimum Rules plus more rules for critical problems in native code
Security Rules Includes rules for finding security vulnerabilities