Skip to content

Commit acbff7a

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

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

.idea/php.xml

+189-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
@@ -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"

0 commit comments

Comments
 (0)