-
Notifications
You must be signed in to change notification settings - Fork 13
/
.sensiolabs.yml
264 lines (254 loc) · 8.25 KB
/
.sensiolabs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# Ignore some branches to avoid triggering analysis for these
ignore_branches:
- gh-pages
# Configure the failure conditions for your commit status.
# If at least one of these conditions is verified, the commit status is displayed as failed.
commit_failure_conditions:
# By severities count (default configuration, any change will override it)
- "project.severity.critical > 0"
- "project.severity.major > 0"
# # By other severities count
# - "project.severity.minor > 0"
# - "project.severity.info >= 15"
#
# # By categories count
# - "project.category.architecture > 0"
# - "project.category.bugrisk > 0"
# - "project.category.codestyle > 0"
# - "project.category.deadcode > 0"
# - "project.category.performance > 0"
# - "project.category.readability > 0"
# - "project.category.security > 0"
#
# # By project grade (none, bronze, silver, gold, platinum)
# - "project.grade < gold"
#
# # By total violations count
# - "project.violations > 150"
#
# By severities count, limited to the violations concerning files edited by the current PR
# - "pr.severity.critical > 0"
# - "pr.severity.major > 0"
# - "pr.severity.minor > 0"
# - "pr.severity.info >= 15"
#
# # By categories count, limited to the violations concerning files edited by the current PR
# - "pr.category.architecture > 0"
# - "pr.category.bugrisk > 0"
# - "pr.category.codestyle > 0"
# - "pr.category.deadcode > 0"
# - "pr.category.performance > 0"
# - "pr.category.readability > 0"
# - "pr.category.security > 0"
#
# # By total violations count, limited to the violations concerning files edited by the current PR
# - "pr.violations > 150"
# Configure rules.
rules:
# Disable a rule
php.class_too_long:
enabled: false
# Configure a rule
php.class_too_long:
max_length: 2000
threshold: 10
# Configure in which directory your code is located.
# This can be set to any subdirectory of your project.
#working_directory: myapp
# This section will be executed before installing dependencies.
# You should configure here what is needed for Composer to run without
# issue: install libraries, prepare the database, etc.
#pre_composer_script: |
# #!/bin/bash
#
# cp app/config/parameters.yml.dist app/config/parameters.yml
# sed -i -e "s/database_user:.*/database_user: root/" app/config/parameters.yml
# sed -i -e "s/database_password:.*/database_password: Secr3t/" app/config/parameters.yml
# This section will be executed after installing dependencies and
# before running the actual analysis.
# You should configure here what is needed for SensioLabsInsight
# to analyse your code.
#post_composer_script: |
# #!/bin/bash
#
# ./app/console doctrine:database:create --no-interaction
# ./app/console doctrine:schema:create --no-interaction
# ./app/console doctrine:fixtures:load --no-interaction
# Configure the directories excluded from the analysis. By default,
# this setting excldues directories commonly used to store tests
# and third-party libraries.
global_exclude_dirs:
- vendor
- vendors
- test
- tests
- Tests
- spec
- features
- Fixtures
- DataFixtures
- var
# Configure patterns used by SensioLabsInsight to exclude specific
# files and directories.
exclude_patterns:
- app/check.php
- app/SymfonyRequirements.php
- web/config.php
- web/app_*.php
rules:
composer.apc_class_loader_should_be_enabled:
enabled: true
composer.dependencies_not_installable:
enabled: true
composer.invalid_file:
enabled: true
composer.outdated_lock_file:
enabled: true
composer.security_issue_in_composer:
enabled: true
composer.unfixed_dependency_version:
enabled: true
composer.warning:
enabled: true
doctrine.database_query_contains_string_and_variable_concatenation:
enabled: true
doctrine.invalid_schema:
enabled: true
doctrine.use_flush_in_loop:
enabled: true
git.user_specific_ignored_file:
enabled: true
html.html_link_contains_javascript:
enabled: true
invalid_e_o_l:
enabled: true
eol: unix
missing_e_o_l:
enabled: true
mock.rule: null
php.absolute_path_present:
enabled: true
allowed_paths: [/dev, /etc, /proc]
php.bad_mutator_method_name_for_boolean_property:
enabled: true
php.boolean_statement:
enabled: true
php.class_too_long:
enabled: true
max_length: 500
threshold: 5
php.commented_out_code:
enabled: true
php.contaminant_third_party_component_license:
enabled: true
php.debug_statements:
enabled: true
php.duplicated_code:
enabled: true
ignore_files:
- Configuration/TCA/*.php
php.dynamically_change_configuration:
enabled: true
php.file_contains_more_than_one_class:
enabled: true
php.for_loop_uses_test_function:
enabled: true
php.interface_has_no_interface_suffix:
enabled: true
interface_name_pattern: /(Interface|Exception|able)$/
php.method_or_property_missing_visibility:
enabled: true
php.method_too_long:
enabled: true
max_length: 50
threshold: 5
php.missing_use_statement:
enabled: true
php.neglected_tests:
enabled: true
php.object_parameter_not_type_hinted:
enabled: true
php.php7_reserved_words:
enabled: true
php.php_magic_methods:
enabled: true
php.php_syntax_error:
enabled: true
php.psr1:
enabled: true
php.silenced_error:
enabled: true
function_whitelist: [unlink, fopen, fwrite, fclose, rename, chmod, mkdir, rmdir, file_put_contents, move_uploaded_file, chgrp, lchgrp, chown, lchown, touch, symlink, highlight_file, ftp_get, ftp_close, ftp_size, ftp_chdir, ftp_delete, ftp_rmdir, ftp_put, ftp_mkdir, ftp_chmod, ftp_nlist, copy, delete, fileatime, filectime, filemtime, is_readable, is_writable, is_writeable, is_executable, is_link, is_file, is_directory, fputs, fsockopen, get_resource_type, getenv, getimagesize, iconv, imagecreatefromstring, ldap_add, ldap_bind, ldap_delete, ldap_get_option, ldap_modify, ldap_search, ldap_set_option, link, posix_isatty, readfile, readlink, stream_socket_client]
php.static_method_should_not_use_this:
enabled: true
php.strict_boolean_comparison_should_be_used:
enabled: true
php.too_many_files_per_folder_for_performance:
enabled: true
max_count: 10000
php.too_permissive_file_permissions:
enabled: true
allowed_dirs: [bin, scripts]
php.unreachable_code:
enabled: true
php.unused_local_variable_or_private_member:
enabled: true
php.unused_use_statement:
enabled: true
php.use_deprecated_function:
enabled: true
php.use_exit_function:
enabled: true
ignore_files:
- Configuration/TCA/*.php
php.use_global_variable_or_function:
enabled: true
php.use_php_ereg_function:
enabled: true
php.use_php_eval_function:
enabled: true
php.use_php_short_open_tag:
enabled: true
php.use_php_sleep_function:
enabled: true
task_fixme_comment:
enabled: true
task_todo_comment:
enabled: true
task_xxx_comment:
enabled: true
third_party.use_deprecated_class:
enabled: true
third_party.use_deprecated_service:
enabled: true
twig.auto_reload_enabled:
enabled: true
twig.debug_enabled:
enabled: true
twig.disabled_escaper:
enabled: true
twig.disabled_strict_variable:
enabled: true
twig.template_too_complex:
enabled: true
max_depth: 5
twig.template_too_long:
enabled: true
max_length: 200
threshold: 5
twig.twig_syntax_error:
enabled: true
twig.xss_vulnerability:
enabled: true
web.apache_config:
enabled: true
web.default_favicon:
enabled: true
web.missing_favicon:
enabled: true
web.missing_robots_txt:
enabled: true
web.non_utf8_encoding:
enabled: true
xml.syntax_error:
enabled: true