degraciamathieu / php-line-length-detector
PHP code smell detector
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 0
Type:package
Requires
- php: ^8.1
- degraciamathieu/php-file-explorer: 0.4.*
- illuminate/view: ^10.0
- laravel-zero/framework: ^10.0
- nunomaduro/termwind: ^1.15
Requires (Dev)
- mockery/mockery: ^1.5.1
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2024-10-15 18:53:32 UTC
README
php-line-length-detector
A simple way to analyze the line length of your PHP files.
Installation
Requires >= PHP 8.1
Phar
This tool is distributed as a PHP Archive (PHAR):
wget https://github.com/DeGraciaMathieu/php-line-length-detector/raw/master/builds/php-line-length-detector
php php-line-length-detector --version
Composer
Alternately, you can directly use composer :
composer require degraciamathieu/php-line-length-detector --dev
Usage
php php-line-length-detector inspect {path}
$ php php-line-length-detector inspect app
❀ PHP Line Lenght Detector ❀
+-------------+--------------+--------------+
| total lines | largest line | average line |
+-------------+--------------+--------------+
| 1068 | 197 | 37 |
+-------------+--------------+--------------+
+--------+------------+---------+
| length | occurrence | percent |
+--------+------------+---------+
| > 160 | 2 | 0 % |
| > 120 | 5 | 0 % |
| > 80 | 29 | 2 % |
| > 60 | 111 | 10 % |
| > 30 | 618 | 57 % |
+--------+------------+---------+
You can configure thresholds with the --thresholds=
option (default : 160,120,80,60,30) :
$ php php-line-length-detector inspect app --thresholds=120,60
❀ PHP Line Lenght Detector ❀
+-------------+--------------+--------------+
| total lines | largest line | average line |
+-------------+--------------+--------------+
| 1068 | 197 | 37 |
+-------------+--------------+--------------+
+--------+------------+---------+
| length | occurrence | percent |
+--------+------------+---------+
| > 120 | 5 | 0 % |
| > 60 | 111 | 10 % |
+--------+------------+---------+