|
15 | 15 | "authors": [ |
16 | 16 | { |
17 | 17 | "name": "Ivan Ponomarev", |
18 | | - "email": "pi@spaf.dev" |
| 18 | + "email": "i.ponomarev@pandev.tech" |
19 | 19 | } |
20 | 20 | ], |
21 | 21 | "type": "library", |
|
25 | 25 | "ext-mbstring": "*" |
26 | 26 | }, |
27 | 27 | "require-dev": { |
28 | | - "squizlabs/php_codesniffer": "^3", |
29 | | - "phpunit/phpunit": "^9" |
| 28 | + "phpunit/phpunit": "^9", |
| 29 | + "phpmd/phpmd": "^2.13" |
30 | 30 | }, |
31 | 31 | "suggest": { |
32 | 32 | "ext-gmp": "GMP Extension (BigNumbers calculation functionality, without fractions support but much quicker)", |
|
39 | 39 | "files": ["src/basic.php"] |
40 | 40 | }, |
41 | 41 | "scripts": { |
42 | | - "tests": [ |
| 42 | + "test": [ |
43 | 43 | "phpunit tests" |
44 | 44 | ], |
45 | | - "tests-clover": [ |
46 | | - "XDEBUG_MODE=coverage phpunit tests --coverage-clover clover.xml" |
| 45 | + "coverage": [ |
| 46 | + "XDEBUG_MODE=coverage phpunit tests --coverage-html docs/reports/coverage/html" |
47 | 47 | ], |
48 | | - "tests-html": [ |
49 | | - "XDEBUG_MODE=coverage phpunit tests --coverage-html html-coverage/" |
| 48 | + "coverage-clover": [ |
| 49 | + "XDEBUG_MODE=coverage phpunit tests --coverage-clover docs/reports/coverage/clover.xml" |
50 | 50 | ], |
51 | | - "code-sniff": [ |
52 | | - "phpcs src/" |
| 51 | + "mess": [ |
| 52 | + "phpmd --ignore-violations-on-exit src/ html codesize,unusedcode,naming > docs/reports/quality/mess-analysis-codesize-report.html" |
| 53 | + ], |
| 54 | + "pipeline-mess": [ |
| 55 | + "phpmd src/ text codesize,unusedcode,naming" |
53 | 56 | ] |
| 57 | + }, |
| 58 | + "scripts-descriptions": { |
| 59 | + "test": "Run the whole PHPUnit test suit", |
| 60 | + "coverage": "Run the whole PHPUnit test with Coverage suit. Output in HTML at \"docs/coverage/html\"", |
| 61 | + "coverage-clover": "Run the whole PHPUnit test with Coverage suit. Output in clover xml at \"docs/coverage/\"", |
| 62 | + "mess": "Runs phpmd Mess Analysis on scopes of \"codesize,unusedcode,naming\". Output in HTML at \"docs/quality/mess-analysis-codesize-report.html\"", |
| 63 | + |
| 64 | + "pipeline-mess": "Runs phpmd Mess Analysis on scopes of \"codesize,unusedcode,naming\" and return non 0 exit status if rules are violated. Reasonable for CI/CD pipelines." |
54 | 65 | } |
55 | 66 | } |
0 commit comments