aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Makefile56
-rw-r--r--composer.json6
-rw-r--r--composer.lock357
3 files changed, 10 insertions, 409 deletions
diff --git a/Makefile b/Makefile
index 56cf09b2..28740690 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,6 @@
3 3
4BIN = vendor/bin 4BIN = vendor/bin
5PHP_SOURCE = index.php application tests plugins 5PHP_SOURCE = index.php application tests plugins
6PHP_COMMA_SOURCE = index.php,application,tests,plugins
7 6
8all: static_analysis_summary check_permissions test 7all: static_analysis_summary check_permissions test
9 8
@@ -18,21 +17,12 @@ docker_%:
18 cd ~/shaarli && make $* 17 cd ~/shaarli && make $*
19 18
20## 19##
21# Concise status of the project
22# These targets are non-blocking: || exit 0
23##
24
25static_analysis_summary: code_sniffer_source copy_paste mess_detector_summary
26 @echo
27
28##
29# PHP_CodeSniffer 20# PHP_CodeSniffer
30# Detects PHP syntax errors 21# Detects PHP syntax errors
31# Documentation (usage, output formatting): 22# Documentation (usage, output formatting):
32# - http://pear.php.net/manual/en/package.php.php-codesniffer.usage.php 23# - http://pear.php.net/manual/en/package.php.php-codesniffer.usage.php
33# - http://pear.php.net/manual/en/package.php.php-codesniffer.reporting.php 24# - http://pear.php.net/manual/en/package.php.php-codesniffer.reporting.php
34## 25##
35
36code_sniffer: code_sniffer_full 26code_sniffer: code_sniffer_full
37 27
38### - errors filtered by coding standard: PEAR, PSR1, PSR2, Zend... 28### - errors filtered by coding standard: PEAR, PSR1, PSR2, Zend...
@@ -52,52 +42,6 @@ code_sniffer_source:
52 @$(BIN)/phpcs $(PHP_SOURCE) --report-source || exit 0 42 @$(BIN)/phpcs $(PHP_SOURCE) --report-source || exit 0
53 43
54## 44##
55# PHP Copy/Paste Detector
56# Detects code redundancy
57# Documentation: https://github.com/sebastianbergmann/phpcpd
58##
59
60copy_paste:
61 @echo "-----------------------"
62 @echo "PHP COPY/PASTE DETECTOR"
63 @echo "-----------------------"
64 @$(BIN)/phpcpd $(PHP_SOURCE) || exit 0
65 @echo
66
67##
68# PHP Mess Detector
69# Detects PHP syntax errors, sorted by category
70# Rules documentation: http://phpmd.org/rules/index.html
71##
72MESS_DETECTOR_RULES = cleancode,codesize,controversial,design,naming,unusedcode
73
74mess_title:
75 @echo "-----------------"
76 @echo "PHP MESS DETECTOR"
77 @echo "-----------------"
78
79### - all warnings
80mess_detector: mess_title
81 @$(BIN)/phpmd $(PHP_COMMA_SOURCE) text $(MESS_DETECTOR_RULES) | sed 's_.*\/__'
82
83### - all warnings + HTML output contains links to PHPMD's documentation
84mess_detector_html:
85 @$(BIN)/phpmd $(PHP_COMMA_SOURCE) html $(MESS_DETECTOR_RULES) \
86 --reportfile phpmd.html || exit 0
87
88### - warnings grouped by message, sorted by descending frequency order
89mess_detector_grouped: mess_title
90 @$(BIN)/phpmd $(PHP_SOURCE) text $(MESS_DETECTOR_RULES) \
91 | cut -f 2 | sort | uniq -c | sort -nr
92
93### - summary: number of warnings by rule set
94mess_detector_summary: mess_title
95 @for rule in $$(echo $(MESS_DETECTOR_RULES) | tr ',' ' '); do \
96 warnings=$$($(BIN)/phpmd $(PHP_COMMA_SOURCE) text $$rule | wc -l); \
97 printf "$$warnings\t$$rule\n"; \
98 done;
99
100##
101# Checks source file & script permissions 45# Checks source file & script permissions
102## 46##
103check_permissions: 47check_permissions:
diff --git a/composer.json b/composer.json
index f5e7a9cd..dccf83b6 100644
--- a/composer.json
+++ b/composer.json
@@ -24,11 +24,9 @@
24 "gettext/gettext": "^4.4" 24 "gettext/gettext": "^4.4"
25 }, 25 },
26 "require-dev": { 26 "require-dev": {
27 "phpmd/phpmd" : "@stable", 27 "phpunit/phpcov": "*",
28 "phpunit/phpunit": "^5.0", 28 "phpunit/phpunit": "^5.0",
29 "sebastian/phpcpd": "*", 29 "squizlabs/php_codesniffer": "2.*"
30 "squizlabs/php_codesniffer": "2.*",
31 "phpunit/phpcov": "*"
32 }, 30 },
33 "autoload": { 31 "autoload": {
34 "psr-4": { 32 "psr-4": {
diff --git a/composer.lock b/composer.lock
index bdf1861c..c43dad6f 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 4 "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
5 "This file is @generated automatically" 5 "This file is @generated automatically"
6 ], 6 ],
7 "content-hash": "0dc33ee0b7d9f47868d4fa961f0d13b4", 7 "content-hash": "3876b34296fedb365517b785af8384de",
8 "packages": [ 8 "packages": [
9 { 9 {
10 "name": "arthurhoaro/web-thumbnailer", 10 "name": "arthurhoaro/web-thumbnailer",
@@ -593,12 +593,12 @@
593 "source": { 593 "source": {
594 "type": "git", 594 "type": "git",
595 "url": "https://github.com/pubsubhubbub/php-publisher.git", 595 "url": "https://github.com/pubsubhubbub/php-publisher.git",
596 "reference": "e8a7cf52a2c86b0c364da56f7192ec020c83b8f7" 596 "reference": "047b0faf6219071527a45942d6fef4dbc6d1d884"
597 }, 597 },
598 "dist": { 598 "dist": {
599 "type": "zip", 599 "type": "zip",
600 "url": "https://api.github.com/repos/pubsubhubbub/php-publisher/zipball/e8a7cf52a2c86b0c364da56f7192ec020c83b8f7", 600 "url": "https://api.github.com/repos/pubsubhubbub/php-publisher/zipball/047b0faf6219071527a45942d6fef4dbc6d1d884",
601 "reference": "e8a7cf52a2c86b0c364da56f7192ec020c83b8f7", 601 "reference": "047b0faf6219071527a45942d6fef4dbc6d1d884",
602 "shasum": "" 602 "shasum": ""
603 }, 603 },
604 "require": { 604 "require": {
@@ -627,9 +627,10 @@
627 "data", 627 "data",
628 "feeds", 628 "feeds",
629 "publishers", 629 "publishers",
630 "pubsubhubbub" 630 "pubsubhubbub",
631 "websub"
631 ], 632 ],
632 "time": "2018-10-05T12:31:04+00:00" 633 "time": "2018-10-09T05:20:28+00:00"
633 }, 634 },
634 { 635 {
635 "name": "shaarli/netscape-bookmark-parser", 636 "name": "shaarli/netscape-bookmark-parser",
@@ -859,46 +860,6 @@
859 "time": "2017-10-19T19:58:43+00:00" 860 "time": "2017-10-19T19:58:43+00:00"
860 }, 861 },
861 { 862 {
862 "name": "pdepend/pdepend",
863 "version": "2.5.2",
864 "source": {
865 "type": "git",
866 "url": "https://github.com/pdepend/pdepend.git",
867 "reference": "9daf26d0368d4a12bed1cacae1a9f3a6f0adf239"
868 },
869 "dist": {
870 "type": "zip",
871 "url": "https://api.github.com/repos/pdepend/pdepend/zipball/9daf26d0368d4a12bed1cacae1a9f3a6f0adf239",
872 "reference": "9daf26d0368d4a12bed1cacae1a9f3a6f0adf239",
873 "shasum": ""
874 },
875 "require": {
876 "php": ">=5.3.7",
877 "symfony/config": "^2.3.0|^3|^4",
878 "symfony/dependency-injection": "^2.3.0|^3|^4",
879 "symfony/filesystem": "^2.3.0|^3|^4"
880 },
881 "require-dev": {
882 "phpunit/phpunit": "^4.8|^5.7",
883 "squizlabs/php_codesniffer": "^2.0.0"
884 },
885 "bin": [
886 "src/bin/pdepend"
887 ],
888 "type": "library",
889 "autoload": {
890 "psr-4": {
891 "PDepend\\": "src/main/php/PDepend"
892 }
893 },
894 "notification-url": "https://packagist.org/downloads/",
895 "license": [
896 "BSD-3-Clause"
897 ],
898 "description": "Official version of pdepend to be handled with Composer",
899 "time": "2017-12-13T13:21:38+00:00"
900 },
901 {
902 "name": "phpdocumentor/reflection-common", 863 "name": "phpdocumentor/reflection-common",
903 "version": "1.0.1", 864 "version": "1.0.1",
904 "source": { 865 "source": {
@@ -1045,72 +1006,6 @@
1045 "time": "2017-07-14T14:27:02+00:00" 1006 "time": "2017-07-14T14:27:02+00:00"
1046 }, 1007 },
1047 { 1008 {
1048 "name": "phpmd/phpmd",
1049 "version": "2.6.0",
1050 "source": {
1051 "type": "git",
1052 "url": "https://github.com/phpmd/phpmd.git",
1053 "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374"
1054 },
1055 "dist": {
1056 "type": "zip",
1057 "url": "https://api.github.com/repos/phpmd/phpmd/zipball/4e9924b2c157a3eb64395460fcf56b31badc8374",
1058 "reference": "4e9924b2c157a3eb64395460fcf56b31badc8374",
1059 "shasum": ""
1060 },
1061 "require": {
1062 "ext-xml": "*",
1063 "pdepend/pdepend": "^2.5",
1064 "php": ">=5.3.9"
1065 },
1066 "require-dev": {
1067 "phpunit/phpunit": "^4.0",
1068 "squizlabs/php_codesniffer": "^2.0"
1069 },
1070 "bin": [
1071 "src/bin/phpmd"
1072 ],
1073 "type": "project",
1074 "autoload": {
1075 "psr-0": {
1076 "PHPMD\\": "src/main/php"
1077 }
1078 },
1079 "notification-url": "https://packagist.org/downloads/",
1080 "license": [
1081 "BSD-3-Clause"
1082 ],
1083 "authors": [
1084 {
1085 "name": "Manuel Pichler",
1086 "email": "github@manuel-pichler.de",
1087 "homepage": "https://github.com/manuelpichler",
1088 "role": "Project Founder"
1089 },
1090 {
1091 "name": "Other contributors",
1092 "homepage": "https://github.com/phpmd/phpmd/graphs/contributors",
1093 "role": "Contributors"
1094 },
1095 {
1096 "name": "Marc Würth",
1097 "email": "ravage@bluewin.ch",
1098 "homepage": "https://github.com/ravage84",
1099 "role": "Project Maintainer"
1100 }
1101 ],
1102 "description": "PHPMD is a spin-off project of PHP Depend and aims to be a PHP equivalent of the well known Java tool PMD.",
1103 "homepage": "http://phpmd.org/",
1104 "keywords": [
1105 "mess detection",
1106 "mess detector",
1107 "pdepend",
1108 "phpmd",
1109 "pmd"
1110 ],
1111 "time": "2017-01-20T14:41:10+00:00"
1112 },
1113 {
1114 "name": "phpspec/prophecy", 1009 "name": "phpspec/prophecy",
1115 "version": "1.8.0", 1010 "version": "1.8.0",
1116 "source": { 1011 "source": {
@@ -1989,56 +1884,6 @@
1989 "time": "2017-02-18T15:18:39+00:00" 1884 "time": "2017-02-18T15:18:39+00:00"
1990 }, 1885 },
1991 { 1886 {
1992 "name": "sebastian/phpcpd",
1993 "version": "3.0.1",
1994 "source": {
1995 "type": "git",
1996 "url": "https://github.com/sebastianbergmann/phpcpd.git",
1997 "reference": "dfed51c1288790fc957c9433e2f49ab152e8a564"
1998 },
1999 "dist": {
2000 "type": "zip",
2001 "url": "https://api.github.com/repos/sebastianbergmann/phpcpd/zipball/dfed51c1288790fc957c9433e2f49ab152e8a564",
2002 "reference": "dfed51c1288790fc957c9433e2f49ab152e8a564",
2003 "shasum": ""
2004 },
2005 "require": {
2006 "php": "^5.6|^7.0",
2007 "phpunit/php-timer": "^1.0.6",
2008 "sebastian/finder-facade": "^1.1",
2009 "sebastian/version": "^1.0|^2.0",
2010 "symfony/console": "^2.7|^3.0|^4.0"
2011 },
2012 "bin": [
2013 "phpcpd"
2014 ],
2015 "type": "library",
2016 "extra": {
2017 "branch-alias": {
2018 "dev-master": "3.0-dev"
2019 }
2020 },
2021 "autoload": {
2022 "classmap": [
2023 "src/"
2024 ]
2025 },
2026 "notification-url": "https://packagist.org/downloads/",
2027 "license": [
2028 "BSD-3-Clause"
2029 ],
2030 "authors": [
2031 {
2032 "name": "Sebastian Bergmann",
2033 "email": "sebastian@phpunit.de",
2034 "role": "lead"
2035 }
2036 ],
2037 "description": "Copy/Paste Detector (CPD) for PHP code.",
2038 "homepage": "https://github.com/sebastianbergmann/phpcpd",
2039 "time": "2017-11-16T08:49:28+00:00"
2040 },
2041 {
2042 "name": "sebastian/recursion-context", 1887 "name": "sebastian/recursion-context",
2043 "version": "2.0.0", 1888 "version": "2.0.0",
2044 "source": { 1889 "source": {
@@ -2255,70 +2100,6 @@
2255 "time": "2017-05-22T02:43:20+00:00" 2100 "time": "2017-05-22T02:43:20+00:00"
2256 }, 2101 },
2257 { 2102 {
2258 "name": "symfony/config",
2259 "version": "v3.4.17",
2260 "source": {
2261 "type": "git",
2262 "url": "https://github.com/symfony/config.git",
2263 "reference": "e5389132dc6320682de3643091121c048ff796b3"
2264 },
2265 "dist": {
2266 "type": "zip",
2267 "url": "https://api.github.com/repos/symfony/config/zipball/e5389132dc6320682de3643091121c048ff796b3",
2268 "reference": "e5389132dc6320682de3643091121c048ff796b3",
2269 "shasum": ""
2270 },
2271 "require": {
2272 "php": "^5.5.9|>=7.0.8",
2273 "symfony/filesystem": "~2.8|~3.0|~4.0",
2274 "symfony/polyfill-ctype": "~1.8"
2275 },
2276 "conflict": {
2277 "symfony/dependency-injection": "<3.3",
2278 "symfony/finder": "<3.3"
2279 },
2280 "require-dev": {
2281 "symfony/dependency-injection": "~3.3|~4.0",
2282 "symfony/event-dispatcher": "~3.3|~4.0",
2283 "symfony/finder": "~3.3|~4.0",
2284 "symfony/yaml": "~3.0|~4.0"
2285 },
2286 "suggest": {
2287 "symfony/yaml": "To use the yaml reference dumper"
2288 },
2289 "type": "library",
2290 "extra": {
2291 "branch-alias": {
2292 "dev-master": "3.4-dev"
2293 }
2294 },
2295 "autoload": {
2296 "psr-4": {
2297 "Symfony\\Component\\Config\\": ""
2298 },
2299 "exclude-from-classmap": [
2300 "/Tests/"
2301 ]
2302 },
2303 "notification-url": "https://packagist.org/downloads/",
2304 "license": [
2305 "MIT"
2306 ],
2307 "authors": [
2308 {
2309 "name": "Fabien Potencier",
2310 "email": "fabien@symfony.com"
2311 },
2312 {
2313 "name": "Symfony Community",
2314 "homepage": "https://symfony.com/contributors"
2315 }
2316 ],
2317 "description": "Symfony Config Component",
2318 "homepage": "https://symfony.com",
2319 "time": "2018-09-08T13:15:14+00:00"
2320 },
2321 {
2322 "name": "symfony/console", 2103 "name": "symfony/console",
2323 "version": "v3.4.17", 2104 "version": "v3.4.17",
2324 "source": { 2105 "source": {
@@ -2444,127 +2225,6 @@
2444 "time": "2018-10-02T16:33:53+00:00" 2225 "time": "2018-10-02T16:33:53+00:00"
2445 }, 2226 },
2446 { 2227 {
2447 "name": "symfony/dependency-injection",
2448 "version": "v3.4.17",
2449 "source": {
2450 "type": "git",
2451 "url": "https://github.com/symfony/dependency-injection.git",
2452 "reference": "aea20fef4e92396928b5db175788b90234c0270d"
2453 },
2454 "dist": {
2455 "type": "zip",
2456 "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/aea20fef4e92396928b5db175788b90234c0270d",
2457 "reference": "aea20fef4e92396928b5db175788b90234c0270d",
2458 "shasum": ""
2459 },
2460 "require": {
2461 "php": "^5.5.9|>=7.0.8",
2462 "psr/container": "^1.0"
2463 },
2464 "conflict": {
2465 "symfony/config": "<3.3.7",
2466 "symfony/finder": "<3.3",
2467 "symfony/proxy-manager-bridge": "<3.4",
2468 "symfony/yaml": "<3.4"
2469 },
2470 "provide": {
2471 "psr/container-implementation": "1.0"
2472 },
2473 "require-dev": {
2474 "symfony/config": "~3.3|~4.0",
2475 "symfony/expression-language": "~2.8|~3.0|~4.0",
2476 "symfony/yaml": "~3.4|~4.0"
2477 },
2478 "suggest": {
2479 "symfony/config": "",
2480 "symfony/expression-language": "For using expressions in service container configuration",
2481 "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required",
2482 "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
2483 "symfony/yaml": ""
2484 },
2485 "type": "library",
2486 "extra": {
2487 "branch-alias": {
2488 "dev-master": "3.4-dev"
2489 }
2490 },
2491 "autoload": {
2492 "psr-4": {
2493 "Symfony\\Component\\DependencyInjection\\": ""
2494 },
2495 "exclude-from-classmap": [
2496 "/Tests/"
2497 ]
2498 },
2499 "notification-url": "https://packagist.org/downloads/",
2500 "license": [
2501 "MIT"
2502 ],
2503 "authors": [
2504 {
2505 "name": "Fabien Potencier",
2506 "email": "fabien@symfony.com"
2507 },
2508 {
2509 "name": "Symfony Community",
2510 "homepage": "https://symfony.com/contributors"
2511 }
2512 ],
2513 "description": "Symfony DependencyInjection Component",
2514 "homepage": "https://symfony.com",
2515 "time": "2018-10-02T12:28:39+00:00"
2516 },
2517 {
2518 "name": "symfony/filesystem",
2519 "version": "v3.4.17",
2520 "source": {
2521 "type": "git",
2522 "url": "https://github.com/symfony/filesystem.git",
2523 "reference": "d69930fc337d767607267d57c20a7403d0a822a4"
2524 },
2525 "dist": {
2526 "type": "zip",
2527 "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4",
2528 "reference": "d69930fc337d767607267d57c20a7403d0a822a4",
2529 "shasum": ""
2530 },
2531 "require": {
2532 "php": "^5.5.9|>=7.0.8",
2533 "symfony/polyfill-ctype": "~1.8"
2534 },
2535 "type": "library",
2536 "extra": {
2537 "branch-alias": {
2538 "dev-master": "3.4-dev"
2539 }
2540 },
2541 "autoload": {
2542 "psr-4": {
2543 "Symfony\\Component\\Filesystem\\": ""
2544 },
2545 "exclude-from-classmap": [
2546 "/Tests/"
2547 ]
2548 },
2549 "notification-url": "https://packagist.org/downloads/",
2550 "license": [
2551 "MIT"
2552 ],
2553 "authors": [
2554 {
2555 "name": "Fabien Potencier",
2556 "email": "fabien@symfony.com"
2557 },
2558 {
2559 "name": "Symfony Community",
2560 "homepage": "https://symfony.com/contributors"
2561 }
2562 ],
2563 "description": "Symfony Filesystem Component",
2564 "homepage": "https://symfony.com",
2565 "time": "2018-10-02T12:28:39+00:00"
2566 },
2567 {
2568 "name": "symfony/finder", 2228 "name": "symfony/finder",
2569 "version": "v3.4.17", 2229 "version": "v3.4.17",
2570 "source": { 2230 "source": {
@@ -2883,8 +2543,7 @@
2883 "aliases": [], 2543 "aliases": [],
2884 "minimum-stability": "stable", 2544 "minimum-stability": "stable",
2885 "stability-flags": { 2545 "stability-flags": {
2886 "pubsubhubbub/publisher": 20, 2546 "pubsubhubbub/publisher": 20
2887 "phpmd/phpmd": 0
2888 }, 2547 },
2889 "prefer-stable": false, 2548 "prefer-stable": false,
2890 "prefer-lowest": false, 2549 "prefer-lowest": false,