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 b2328f7

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

File tree

19 files changed

+2915
-976
lines changed

19 files changed

+2915
-976
lines changed
 

‎.idea/htdocs.iml

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

‎.idea/php.xml

Lines changed: 2223 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
@@ -311,7 +311,19 @@ else
311311
endif
312312

313313
phpcpd: ## Runs php copy/paste detector
314-
@make exec cmd="php ./vendor/bin/phpcpd --fuzzy --verbose app tests"
314+
@make exec-bash cmd="mkdir -p reports/phpcpd && php ./vendor/bin/phpcpd --fuzzy --verbose --log-pmd=reports/phpcpd/phpcpd-report-v1.xml app tests"
315+
316+
phpcpd-html-report: ## Generates phpcpd html report
317+
ifeq ($(INSIDE_DOCKER_CONTAINER), 1)
318+
@if [ ! -f reports/phpcpd/phpcpd-report-v1.xml ] ; then \
319+
printf "\033[32;49mreports/phpcpd/phpcpd-report-v1.xml not found, please run phpcpd.\033[39m\n" ; \
320+
else \
321+
printf "\033[32;49mCreating reports/phpcpd/phpcpd-report-v1.html report...\033[39m\n" ; \
322+
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 ; \
323+
fi;
324+
else
325+
@make exec-bash cmd="make phpcpd-html-report"
326+
endif
315327

316328
phpmd: ## Runs php mess detector
317329
@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
@@ -78,6 +78,7 @@ make ecs-fix # Runs Easy Coding Standard tool to fix issues
7878
make phpcs # Runs PHP CodeSniffer
7979
make phpmetrics # Generates PhpMetrics static analysis report
8080
make phpcpd # Runs php copy/paste detector
81+
make phpcpd-html-report # Generates phpcpd html report
8182
make phpmd # Runs php mess detector
8283
make phpstan # Runs PhpStan static analysis tool
8384
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
@@ -244,6 +244,7 @@ make ecs
244244
make ecs-fix
245245
make phpmetrics
246246
make phpcpd
247+
make phpcpd-html-report
247248
make phpmd
248249
make phpstan
249250
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.