Conditions | 1 |
Paths | 1 |
Total Lines | 116 |
Code Lines | 97 |
Lines | 0 |
Ratio | 0 % |
Changes | 6 | ||
Bugs | 2 | Features | 3 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
212 | public function getDefinitions() |
||
213 | { |
||
214 | return array( |
||
215 | 'language'=>array( |
||
216 | 'label'=>Yii::t('Settings', 'Application language'), |
||
217 | 'separator'=>array( |
||
218 | 'icon'=>'fa fa-pencil-square-o', |
||
219 | 'label'=>Yii::t('Settings', 'Look and feel'), |
||
220 | ), |
||
221 | 'type'=>self::TYPE_DROPDOWN, |
||
222 | 'default'=>'en', |
||
223 | 'description'=>Yii::t('Settings', 'Changing this will reset the default language for all users'), |
||
224 | 'listData'=>LanguageManager::getAvailableLanguages(), |
||
225 | 'order'=>50, |
||
226 | ), |
||
227 | 'applicationName'=>array( |
||
228 | 'label'=>Yii::t('Settings', 'Application name'), |
||
229 | 'type'=>self::TYPE_TEXT, |
||
230 | 'default'=>'XBMC Video Server', |
||
231 | 'order'=>100, |
||
232 | ), |
||
233 | 'applicationSubtitle'=>array( |
||
234 | 'label'=>Yii::t('Settings', 'Application subtitle'), |
||
235 | 'type'=>self::TYPE_TEXT, |
||
236 | 'default'=>Yii::t('Misc', 'Free your library'), |
||
237 | 'order'=>125, |
||
238 | ), |
||
239 | 'playlistFormat'=>array( |
||
240 | 'label'=>Yii::t('Settings', 'Playlist format'), |
||
241 | 'type'=>self::TYPE_DROPDOWN, |
||
242 | 'default'=>'m3u', |
||
243 | 'listData'=>PlaylistFactory::getTypes(), |
||
244 | 'order'=>150, |
||
245 | ), |
||
246 | 'singleFilePlaylist'=>array( |
||
247 | 'label'=>Yii::t('Settings', "Don't use playlists when item consists of a single file"), |
||
248 | 'type'=>self::TYPE_CHECKBOX, |
||
249 | 'default'=>'0', |
||
250 | 'description'=>Yii::t('Settings', 'You may have to right-click and copy the address in order to stream (not download) the file'), |
||
251 | 'order'=>200, |
||
252 | ), |
||
253 | 'showHelpBlocks'=>array( |
||
254 | 'label'=>Yii::t('Settings', 'Show help blocks throughout the site'), |
||
255 | 'type'=>self::TYPE_CHECKBOX, |
||
256 | 'default'=>'1', |
||
257 | 'order'=>300, |
||
258 | ), |
||
259 | 'pagesize'=>array( |
||
260 | 'label'=>Yii::t('Settings', 'Amount of results to show per page'), |
||
261 | 'type'=>self::TYPE_TEXT, |
||
262 | 'default'=>'60', |
||
263 | 'description'=>Yii::t('Settings', 'Leave empty to disable pagination altogether'), |
||
264 | 'htmlOptions'=>array( |
||
265 | 'span'=>1, |
||
266 | ), |
||
267 | 'order'=>500, |
||
268 | ), |
||
269 | 'ignoreArticle'=>array( |
||
270 | 'label'=>Yii::t('Settings', 'Ignore article ("the") in results'), |
||
271 | 'type'=>self::TYPE_CHECKBOX, |
||
272 | 'default'=>'', |
||
273 | 'order'=>550, |
||
274 | ), |
||
275 | 'requestTimeout'=>array( |
||
276 | 'label'=>Yii::t('Settings', 'Request timeout'), |
||
277 | 'separator'=>array( |
||
278 | 'icon'=>'fa fa-lock', |
||
279 | 'label'=>Yii::t('Settings', 'Security and performance') |
||
280 | ), |
||
281 | 'type'=>self::TYPE_TEXT, |
||
282 | 'default'=>'30', |
||
283 | 'description'=>Yii::t('Settings', 'Determines how long the application should wait for a response from XBMC. Increase this if you get timeout errors.'), |
||
284 | 'htmlOptions'=>array( |
||
285 | 'span'=>1, |
||
286 | ), |
||
287 | 'order'=>625, |
||
288 | ), |
||
289 | 'cacheApiCalls'=>array( |
||
290 | 'label'=>Yii::t('Settings', 'Cache all API results'), |
||
291 | 'type'=>self::TYPE_CHECKBOX, |
||
292 | 'default'=>'0', |
||
293 | 'description'=>Yii::t('Settings', 'Useful on slow hardware. A refresh button will appear in the menu which flushes the cache'), |
||
294 | 'order'=>650, |
||
295 | ), |
||
296 | 'enableActorTypeahead'=>array( |
||
297 | 'label'=>Yii::t('Settings', 'Enable auto-complete for actor names'), |
||
298 | 'type'=>self::TYPE_CHECKBOX, |
||
299 | 'default'=>'0', |
||
300 | 'description'=>Yii::t('Settings', 'Decreases performance, especially on large libraries and/or slow hardware'), |
||
301 | 'order'=>675, |
||
302 | ), |
||
303 | 'useHttpsForVfsUrls'=>array( |
||
304 | 'label'=>Yii::t('Settings', 'Use HTTPS when streaming'), |
||
305 | 'type'=>self::TYPE_CHECKBOX, |
||
306 | 'default'=>'0', |
||
307 | 'description'=>Yii::t('Settings', 'When checked, streaming will be done over HTTPS if the application is accessed over HTTPS. This will usually only work if the server uses a real signed certificate, thus it is not enabled by default.'), |
||
308 | 'order'=>700, |
||
309 | ), |
||
310 | 'allowUserPowerOff'=>array( |
||
311 | 'label'=>Yii::t('Settings', 'Allow users to power off backends'), |
||
312 | 'type'=>self::TYPE_CHECKBOX_LIST, |
||
313 | 'default'=>'', |
||
314 | 'listData'=>array( |
||
315 | Setting::POWER_OPTION_SHUTDOWN=>Yii::t('Settings', 'Shutdown'), |
||
316 | Setting::POWER_OPTION_SUSPEND=>Yii::t('Settings', 'Suspend'), |
||
317 | Setting::POWER_OPTION_HIBERNATE=>Yii::t('Settings', 'Hibernate'), |
||
318 | Setting::POWER_OPTION_REBOOT=>Yii::t('Settings', 'Reboot')), |
||
319 | 'description'=>Yii::t('Settings', 'Administrators are not affected by this setting and can always power off backends'), |
||
320 | 'order'=>750, |
||
321 | ), |
||
322 | 'whitelist'=>array( |
||
323 | 'label'=>Yii::t('Settings', 'Access whitelist'), |
||
324 | 'type'=>self::TYPE_TEXT_WIDE, |
||
325 | 'default'=>'', |
||
326 | 'description'=>Yii::t('Settings', 'If specified, access is restricted to the defined whitelist. Valid values are IP addresses, IP subnets and domain names (including wildcards). Example: 192.168.1.0/24,1.2.3.4,example.com,*.user.com'), |
||
327 | 'order'=>800, |
||
328 | ), |
||
333 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths