Ingore all violations for a given rule
Some projects may find SymfonyInsight analyses too exhaustive or too strict. In those cases, you can opt for ignoring all the violations related to a particular analysis rule. To do so, follow these steps:
- Go to any analysis page, locate the rule to ignore and click on the small trash icon displayed at the right of the rule title.
- Optionally, use the pop-up form to comment the reasons for ignoring these
violations and check the
Stop analyzing this rule
option to prevent them from appearing again in future analyses.
Ignoring rule violations permanently
Alternatively, you can use the custom project configuration to ignore or to modify the behavior of every SymfonyInsight rule:
- Click on the
Edit project
link at the top right of a project or analysis page. Ignore rule violations by adding a custom project configuration in the
Configuration
option. For instance, if you want to ignore the rule that checks the length of the PHP classes, use this configuration:1 2 3
rules: php.class_too_long: enabled: false
If you don't want to disable a rule entirely, you can tweak its behavior to be less strict. Using the same example as above, replace the previous configuration with the following, to increase the limits defined by this rule:
1 2 3 4
rules: php.class_too_long: max_length: 2000 threshold: 10
Click on the
View sample
link at the bottom of that page to get the complete SymfonyInsight configuration reference. This reference contains all the available rules and all their configuration parameters and default values.