Quick backup before crash

This commit is contained in:
Dennis Eichhorn 2023-06-13 18:55:50 +00:00
parent cf4e186e62
commit 9dc57ef504
2 changed files with 40 additions and 22 deletions

View File

@ -109,17 +109,6 @@
</properties>
<exclude-pattern>*Measurement.php</exclude-pattern>
</rule> -->
<rule ref="Generic.Metrics.NestingLevel">
<properties>
<property name="nestingLevel" value="5"/>
<property name="absoluteNestingLevel" value="11"/>
</properties>
<exclude-pattern>*EigenvalueDecomposition.php</exclude-pattern><!-- Algorithm uses deep nesting -->
<exclude-pattern>*phpOMS/Message/Http/HttpRequest.php</exclude-pattern><!-- Multipart uses deep nesting -->
<exclude-pattern>*Router.php</exclude-pattern><!-- WebRouter uses deep nesting -->
<exclude-pattern>*Mail.php</exclude-pattern><!-- Mail uses deep nesting -->
<exclude-pattern>*Exchange/Interfaces*</exclude-pattern><!-- Exchange interfaces can be deeply nested -->
</rule>
<rule ref="Generic.PHP.RequireStrictTypes"/>
<rule ref="Generic.NamingConventions.ConstructorName"/>
<rule ref="Generic.NamingConventions.UpperCaseConstantName"/>

View File

@ -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 ./