ohnotnow / laravel-find-unused-code

Find unused code in laravel projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is little ugly hack of a console command to list unused methods from Laravel projects.

Installation

Just copy the FindUnusedMethods.php and/or FindUnusedClasses.php files to your app/Console/Commands/ directory.

Usage

Run :

php artisan findunused:methods
php artisan findunused:classes

Details

This just looks for any function nameOfThing definitions in your app directory, then looks for any matching calls to nameOfThing elsewhere in your app or views directories. It's a very 'dumb' match so don't take this as 100% truth. It does an ok job of spotting unused methods and will ignore certain laravel conventions such as ignoring handle methods on generated classes, CRUD methods on controllers.

Much the same hackyness for the 'classes' version.

Just to repeat, it is very hacky.

About

Find unused code in laravel projects

License:MIT License


Languages

Language:PHP 100.0%