https://github.com/degraciamathieu/php-wording-detector
Simple tool to analyze and split the words contained in your code to check your DDD approach.
https://github.com/degraciamathieu/php-wording-detector
ci ddd metrics php quality static-analyzer
Last synced: 11 months ago
JSON representation
Simple tool to analyze and split the words contained in your code to check your DDD approach.
- Host: GitHub
- URL: https://github.com/degraciamathieu/php-wording-detector
- Owner: DeGraciaMathieu
- Created: 2023-03-04T16:13:04.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-05-13T06:52:34.000Z (about 2 years ago)
- Last Synced: 2024-12-13T13:41:34.268Z (over 1 year ago)
- Topics: ci, ddd, metrics, php, quality, static-analyzer
- Language: PHP
- Homepage:
- Size: 72.7 MB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/DeGraciaMathieu/php-wording-detector/actions/workflows/phpunit.yml)


# php-wording-detector
Simple tool to analyze and split the words contained in your code to check your DDD approach.
# Installation
```
Requires >= PHP 8.1
```
## Phar
This tool is distributed as a [PHP Archive (PHAR)](https://www.php.net/phar):
```
wget https://github.com/DeGraciaMathieu/php-wording-detector/raw/master/builds/php-wording-detector
```
```
php php-wording-detector --version
```
## Composer
Alternately, you can directly use composer :
```
composer require degraciamathieu/php-wording-detector --dev
```
# Usage
By default only variables are analyzed :
```
php php-wording-detector inspect {path}
```
The `--with-method` option allows to parse the name of the methods :
```
php php-wording-detector inspect {path} --with-method
```
```
$ php php-wording-detector inspect app/Domains/Activity
❀ PHP Wording Detector ❀
+-------------+-----------------------+-------------+
| total words | total distincts words | average use |
+-------------+-----------------------+-------------+
| 2'166 | 52 | 42 |
+-------------+-----------------------+-------------+
+--------------+-------+------------+
| words | usage | percentage |
+--------------+-------+------------+
| activity | 667 | 31% |
| data | 154 | 7% |
| code | 150 | 7% |
| item | 143 | 7% |
| query | 128 | 6% |
| request | 88 | 4% |
| mode | 85 | 4% |
| translations | 78 | 4% |
| id | 77 | 4% |
| type | 63 | 3% |
| new | 46 | 2% |
| product | 41 | 2% |
| translation | 41 | 2% |
| types | 40 | 2% |
| master | 33 | 2% |
| filters | 29 | 1% |
| language | 24 | 1% |
| builder | 23 | 1% |
| items | 22 | 1% |
| section | 21 | under 1% |
+--------------+-------+------------+
```