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