Skip to content

Commit b2328f7

Browse files
author
DKravtsov
committed
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

-190
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php.xml

+2,223-190
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

+1
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

+13-1
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"

0 commit comments

Comments
 (0)