From 9dc57ef50475e708dfa1fe84c82fce31f84b0f6d Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 13 Jun 2023 18:55:50 +0000 Subject: [PATCH] Quick backup before crash --- Config/phpcs.xml | 11 --------- Helper/inspectproject.sh | 51 +++++++++++++++++++++++++++++++--------- 2 files changed, 40 insertions(+), 22 deletions(-) diff --git a/Config/phpcs.xml b/Config/phpcs.xml index 76d7067..7e1d789 100755 --- a/Config/phpcs.xml +++ b/Config/phpcs.xml @@ -109,17 +109,6 @@ *Measurement.php --> - - - - - - *EigenvalueDecomposition.php - *phpOMS/Message/Http/HttpRequest.php - *Router.php - *Mail.php - *Exchange/Interfaces* - diff --git a/Helper/inspectproject.sh b/Helper/inspectproject.sh index 0ce73d4..d1864e2 100755 --- a/Helper/inspectproject.sh +++ b/Helper/inspectproject.sh @@ -3,23 +3,52 @@ SCRIPT=$(readlink -f "$0") BPATH=$(dirname "$SCRIPT") -# php/js strict checks -printf "\nStrict checks\n\n" -grep -r -L "declare(strict_types=1);" --include=*.php --exclude-dir={*vendor*,*Files*,*privateSetup*,*demoSetup*,*LanguageDetection*} --exclude={*.tpl.php,*Hooks.php,*Routes.php,*SearchCommands.php} ${BPATH}/../../phpOMS ${BPATH}/../../Web ${BPATH}/../../Modules ${BPATH}/../../Model +echo "#################################################" +echo "PHP strict" +echo "#################################################" + +grep -r -L "declare(strict_types=1);" --include=*.php --exclude-dir={*vendor*,*Files*,*privateSetup*,*demoSetup*,*LanguageDetection*,*Resources*,*node_modules*,*privateSetup*,*Build*} --exclude={*.tpl.php,*Hooks.php,*Routes.php,*SearchCommands.php} ${BPATH}/../../phpOMS ${BPATH}/../../Web ${BPATH}/../../Modules ${BPATH}/../../Model + +echo "#################################################" +echo "JS security inspection" +echo "#################################################" -# js uses on actions -printf "\nJs Action checks\n\n" grep -rlni "onafterprint=\|onbeforeprint=\|onbeforeunload=\|onerror=\|onhaschange=\|onload=\|onmessage=\|onoffline=\|ononline=\|onpagehide=\|onpageshow=\|onpopstate=\|onredo=\|onresize=\|onstorage=\|onund=o\|onunload=\|onblur=\|onchage=\|oncontextmenu=\|onfocus=\|onformchange=\|onforminput=\|oninput=\|oninvalid=\|onreset=\|onselect=\|onsubmit=\|onkeydown=\|onkeypress=\|onkeyup=\|onclick=\|ondblclic=k\|ondrag=\|ondragend=\|ondragenter=\|ondragleave=\|ondragover=\|ondragstart=\|ondrop=\|onmousedown=\|onmousemove=\|onmouseout=\|onmouseover=\|onmouseup=\|onmousewheel=\|onscroll=\|onabor=t\|oncanplay=\|oncanplaythrough=\|ondurationchange=\|onemptied=\|onended=\|onerror=\|onloadeddata=\|onloadedmetadata=\|onloadstart=\|onpause=\|onplay=\|onplaying=\|onprogress=\|onratechange=\|onreadystatechange=\|onseeked=\|onseeking=\|onstalled=\|onsuspend=\|ontimeupdate=\|onvolumechange=" --include=*.js ${BPATH}/../../jsOMS ${BPATH}/../../Model ${BPATH}/../../Modules ${BPATH}/../../Web -# php cs + phpstan + eslint -printf "\nPHPCS checks\n\n" +echo "#################################################" +echo "PHPCS" +echo "#################################################" + ./vendor/bin/phpcs --severity=1 ./ --standard="Build/Config/phpcs.xml" -printf "\nPHPStan checks\n\n" +echo "#################################################" +echo "PHP static inspection" +echo "#################################################" + ./vendor/bin/phpstan analyse -l 9 -c Build/Config/phpstan.neon ./ -# printf "\nRector\n\n" -# vendor/bin/rector process --config Build/Config/rector.php ./ +echo "#################################################" +echo "Rector inspection" +echo "#################################################" + +# vendor/bin/rector process --config Build/Config/rector.php --dry-run ./ + +echo "#################################################" +echo "ESlint" +echo "#################################################" -printf "\nESlint checks\n\n" npx eslint jsOMS/ -c Build/Config/.eslintrc.json + +echo "#################################################" +echo "MYSQL queries" +echo "#################################################" + +mysqldumpslow -t 10 /var/log/mysql/mysql-slow.log +mysqldumpslow -t 10 -s l /var/log/mysql/mysql-slow.log +pt-query-digest /var/log/mysql/mysql-slow.log + +echo "#################################################" +echo "PHP stats inspection" +echo "#################################################" + +./vendor/bin/phploc --exclude vendor --exclude node_modules --exclude Resources --exclude Build --exclude .git --exclude privateSetup --exclude demoSetup ./