| Conditions | 1 |
| Paths | 1 |
| Total Lines | 97 |
| Code Lines | 53 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 2 | Features | 0 |
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 |
||
| 258 | public static function routes() |
||
| 259 | { |
||
| 260 | $middleware = [ CreateDefaultFolder::class, MultiUser::class ]; |
||
| 261 | $as = 'unisharp.lfm.'; |
||
| 262 | $namespace = '\\UniSharp\\LaravelFilemanager\\Controllers\\'; |
||
| 263 | |||
| 264 | Route::group(compact('middleware', 'as', 'namespace'), function () { |
||
| 265 | |||
| 266 | // display main layout |
||
| 267 | Route::get('/', [ |
||
| 268 | 'uses' => 'LfmController@show', |
||
| 269 | 'as' => 'show', |
||
| 270 | ]); |
||
| 271 | |||
| 272 | // display integration error messages |
||
| 273 | Route::get('/errors', [ |
||
| 274 | 'uses' => 'LfmController@getErrors', |
||
| 275 | 'as' => 'getErrors', |
||
| 276 | ]); |
||
| 277 | |||
| 278 | // upload |
||
| 279 | Route::any('/upload', [ |
||
| 280 | 'uses' => 'UploadController@upload', |
||
| 281 | 'as' => 'upload', |
||
| 282 | ]); |
||
| 283 | |||
| 284 | // list images & files |
||
| 285 | Route::get('/jsonitems', [ |
||
| 286 | 'uses' => 'ItemsController@getItems', |
||
| 287 | 'as' => 'getItems', |
||
| 288 | ]); |
||
| 289 | |||
| 290 | Route::get('/move', [ |
||
| 291 | 'uses' => 'ItemsController@move', |
||
| 292 | 'as' => 'move', |
||
| 293 | ]); |
||
| 294 | |||
| 295 | Route::get('/domove', [ |
||
| 296 | 'uses' => 'ItemsController@domove', |
||
| 297 | 'as' => 'domove' |
||
| 298 | ]); |
||
| 299 | |||
| 300 | // folders |
||
| 301 | Route::get('/newfolder', [ |
||
| 302 | 'uses' => 'FolderController@getAddfolder', |
||
| 303 | 'as' => 'getAddfolder', |
||
| 304 | ]); |
||
| 305 | |||
| 306 | // list folders |
||
| 307 | Route::get('/folders', [ |
||
| 308 | 'uses' => 'FolderController@getFolders', |
||
| 309 | 'as' => 'getFolders', |
||
| 310 | ]); |
||
| 311 | |||
| 312 | // crop |
||
| 313 | Route::get('/crop', [ |
||
| 314 | 'uses' => 'CropController@getCrop', |
||
| 315 | 'as' => 'getCrop', |
||
| 316 | ]); |
||
| 317 | Route::get('/cropimage', [ |
||
| 318 | 'uses' => 'CropController@getCropimage', |
||
| 319 | 'as' => 'getCropimage', |
||
| 320 | ]); |
||
| 321 | Route::get('/cropnewimage', [ |
||
| 322 | 'uses' => 'CropController@getNewCropimage', |
||
| 323 | 'as' => 'getCropnewimage', |
||
| 324 | ]); |
||
| 325 | |||
| 326 | // rename |
||
| 327 | Route::get('/rename', [ |
||
| 328 | 'uses' => 'RenameController@getRename', |
||
| 329 | 'as' => 'getRename', |
||
| 330 | ]); |
||
| 331 | |||
| 332 | // scale/resize |
||
| 333 | Route::get('/resize', [ |
||
| 334 | 'uses' => 'ResizeController@getResize', |
||
| 335 | 'as' => 'getResize', |
||
| 336 | ]); |
||
| 337 | Route::get('/doresize', [ |
||
| 338 | 'uses' => 'ResizeController@performResize', |
||
| 339 | 'as' => 'performResize', |
||
| 340 | ]); |
||
| 341 | |||
| 342 | // download |
||
| 343 | Route::get('/download', [ |
||
| 344 | 'uses' => 'DownloadController@getDownload', |
||
| 345 | 'as' => 'getDownload', |
||
| 346 | ]); |
||
| 347 | |||
| 348 | // delete |
||
| 349 | Route::get('/delete', [ |
||
| 350 | 'uses' => 'DeleteController@getDelete', |
||
| 351 | 'as' => 'getDelete', |
||
| 352 | ]); |
||
| 353 | |||
| 354 | Route::get('/demo', 'DemoController@index'); |
||
| 355 | }); |
||
| 358 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.