| 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 |
||
| 248 | public static function routes() |
||
| 249 | { |
||
| 250 | $middleware = [ CreateDefaultFolder::class, MultiUser::class ]; |
||
| 251 | $as = 'unisharp.lfm.'; |
||
| 252 | $namespace = '\\UniSharp\\LaravelFilemanager\\Controllers\\'; |
||
| 253 | |||
| 254 | Route::group(compact('middleware', 'as', 'namespace'), function () { |
||
| 255 | |||
| 256 | // display main layout |
||
| 257 | Route::get('/', [ |
||
| 258 | 'uses' => 'LfmController@show', |
||
| 259 | 'as' => 'show', |
||
| 260 | ]); |
||
| 261 | |||
| 262 | // display integration error messages |
||
| 263 | Route::get('/errors', [ |
||
| 264 | 'uses' => 'LfmController@getErrors', |
||
| 265 | 'as' => 'getErrors', |
||
| 266 | ]); |
||
| 267 | |||
| 268 | // upload |
||
| 269 | Route::any('/upload', [ |
||
| 270 | 'uses' => 'UploadController@upload', |
||
| 271 | 'as' => 'upload', |
||
| 272 | ]); |
||
| 273 | |||
| 274 | // list images & files |
||
| 275 | Route::get('/jsonitems', [ |
||
| 276 | 'uses' => 'ItemsController@getItems', |
||
| 277 | 'as' => 'getItems', |
||
| 278 | ]); |
||
| 279 | |||
| 280 | Route::get('/move', [ |
||
| 281 | 'uses' => 'ItemsController@move', |
||
| 282 | 'as' => 'move', |
||
| 283 | ]); |
||
| 284 | |||
| 285 | Route::get('/domove', [ |
||
| 286 | 'uses' => 'ItemsController@domove', |
||
| 287 | 'as' => 'domove' |
||
| 288 | ]); |
||
| 289 | |||
| 290 | // folders |
||
| 291 | Route::get('/newfolder', [ |
||
| 292 | 'uses' => 'FolderController@getAddfolder', |
||
| 293 | 'as' => 'getAddfolder', |
||
| 294 | ]); |
||
| 295 | |||
| 296 | // list folders |
||
| 297 | Route::get('/folders', [ |
||
| 298 | 'uses' => 'FolderController@getFolders', |
||
| 299 | 'as' => 'getFolders', |
||
| 300 | ]); |
||
| 301 | |||
| 302 | // crop |
||
| 303 | Route::get('/crop', [ |
||
| 304 | 'uses' => 'CropController@getCrop', |
||
| 305 | 'as' => 'getCrop', |
||
| 306 | ]); |
||
| 307 | Route::get('/cropimage', [ |
||
| 308 | 'uses' => 'CropController@getCropimage', |
||
| 309 | 'as' => 'getCropimage', |
||
| 310 | ]); |
||
| 311 | Route::get('/cropnewimage', [ |
||
| 312 | 'uses' => 'CropController@getNewCropimage', |
||
| 313 | 'as' => 'getCropimage', |
||
| 314 | ]); |
||
| 315 | |||
| 316 | // rename |
||
| 317 | Route::get('/rename', [ |
||
| 318 | 'uses' => 'RenameController@getRename', |
||
| 319 | 'as' => 'getRename', |
||
| 320 | ]); |
||
| 321 | |||
| 322 | // scale/resize |
||
| 323 | Route::get('/resize', [ |
||
| 324 | 'uses' => 'ResizeController@getResize', |
||
| 325 | 'as' => 'getResize', |
||
| 326 | ]); |
||
| 327 | Route::get('/doresize', [ |
||
| 328 | 'uses' => 'ResizeController@performResize', |
||
| 329 | 'as' => 'performResize', |
||
| 330 | ]); |
||
| 331 | |||
| 332 | // download |
||
| 333 | Route::get('/download', [ |
||
| 334 | 'uses' => 'DownloadController@getDownload', |
||
| 335 | 'as' => 'getDownload', |
||
| 336 | ]); |
||
| 337 | |||
| 338 | // delete |
||
| 339 | Route::get('/delete', [ |
||
| 340 | 'uses' => 'DeleteController@getDelete', |
||
| 341 | 'as' => 'getDelete', |
||
| 342 | ]); |
||
| 343 | |||
| 344 | Route::get('/demo', 'DemoController@index'); |
||
| 345 | }); |
||
| 348 |
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.