Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit acbff7a

Browse files
author
DKravtsov
committedMay 4, 2025·
Updated composer dependencies. Added xalan tool for generating phpcpd html report.
1 parent 2d083ea commit acbff7a

File tree

19 files changed

+886
-787
lines changed

19 files changed

+886
-787
lines changed
 

‎.idea/htdocs.iml

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎.idea/php.xml

Lines changed: 189 additions & 190 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \
4242
sudo \
4343
libzip-dev \
4444
debsecan \
45+
xalan \
4546
&& docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \
4647
&& docker-php-ext-configure intl \
4748
&& docker-php-ext-install \

‎Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,19 @@ else
325325
endif
326326

327327
phpcpd: ## Runs php copy/paste detector
328-
@make exec cmd="php ./vendor/bin/phpcpd --fuzzy --verbose app tests"
328+
@make exec-bash cmd="mkdir -p reports/phpcpd && php ./vendor/bin/phpcpd --fuzzy --verbose --log-pmd=reports/phpcpd/phpcpd-report-v1.xml app tests"
329+
330+
phpcpd-html-report: ## Generates phpcpd html report
331+
ifeq ($(INSIDE_DOCKER_CONTAINER), 1)
332+
@if [ ! -f reports/phpcpd/phpcpd-report-v1.xml ] ; then \
333+
printf "\033[32;49mreports/phpcpd/phpcpd-report-v1.xml not found, please run phpcpd.\033[39m\n" ; \
334+
else \
335+
printf "\033[32;49mCreating reports/phpcpd/phpcpd-report-v1.html report...\033[39m\n" ; \
336+
xalan -in reports/phpcpd/phpcpd-report-v1.xml -xsl https://systemsdk.github.io/phpcpd/report/phpcpd-html-v1_0_0.xslt -out reports/phpcpd/phpcpd-report-v1.html ; \
337+
fi;
338+
else
339+
@make exec-bash cmd="make phpcpd-html-report"
340+
endif
329341

330342
phpmd: ## Runs php mess detector
331343
@make exec cmd="php ./vendor/bin/phpmd app,tests text phpmd_ruleset.xml --suffixes php"

‎composer.lock

Lines changed: 168 additions & 144 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎docs/commands.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ make ecs-fix # Runs Easy Coding Standard tool to fix issues
8080
make phpcs # Runs PHP CodeSniffer
8181
make phpmetrics # Generates PhpMetrics static analysis report
8282
make phpcpd # Runs php copy/paste detector
83+
make phpcpd-html-report # Generates phpcpd html report
8384
make phpmd # Runs php mess detector
8485
make phpstan # Runs PhpStan static analysis tool
8586
make phpinsights # Runs Php Insights analysis tool

‎docs/development.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@ make phpmd
107107
### PHP copy/paste detector
108108
This tool is a copy/paste detector for PHP code.
109109

110-
PHP copy/paste detector is available for dev/test environment using next local shell command:
110+
PHP copy/paste detector is available for dev/test environment using next local shell commands:
111111
```bash
112112
make phpcpd
113+
make phpcpd-html-report
113114
```
114115

115116
### Composer tools

‎readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ make ecs
246246
make ecs-fix
247247
make phpmetrics
248248
make phpcpd
249+
make phpcpd-html-report
249250
make phpmd
250251
make phpstan
251252
make phpinsights

‎tools/01_phpunit/composer.lock

Lines changed: 55 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tools/02_phpstan/composer.lock

Lines changed: 112 additions & 108 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tools/03_ecs/composer.lock

Lines changed: 53 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tools/04_php-coveralls/composer.lock

Lines changed: 51 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tools/05_phpinsights/composer.lock

Lines changed: 69 additions & 65 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tools/06_phpmd/composer.lock

Lines changed: 41 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tools/07_phpmetrics/composer.lock

Lines changed: 14 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tools/08_rector/composer.lock

Lines changed: 26 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tools/09_composer/composer.lock

Lines changed: 63 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tools/10_phpcpd/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"php": "^8.4.0"
66
},
77
"require-dev": {
8-
"systemsdk/phpcpd": "8.1.*",
8+
"systemsdk/phpcpd": "8.2.*",
99
"roave/security-advisories": "dev-latest"
1010
},
1111
"config": {

‎tools/10_phpcpd/composer.lock

Lines changed: 21 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.