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