陇南网站定制开发公司,东莞行业网站建设,手机网站表单页面制作,薛城做网站Warnings插件#xff0c;收集静态分析工具报告的编译器警告或问题#xff0c;并将结果可视化。它内置了对许多编译器的支持#xff08;cpp#xff0c;clang#xff0c;java等#xff09;和工具#xff08;spotbugs#xff0c;pmd#xff0c;checkstyle#xff0c;esl… Warnings插件收集静态分析工具报告的编译器警告或问题并将结果可视化。它内置了对许多编译器的支持cppclangjava等和工具spotbugspmdcheckstyleeslintphpstan. 安装
Dashboard -- 系统管理 -- 插件管理 -- Available plugins
搜索 Warnings, 点击安装项目配置
CheckStyle分析
PHPCS产生 分析报告
Dashboard -- 项目名称 -- 配置 -- Build Steps选择 Run with timeout 或者 Run shell 安装phpcs
#安装phpcs
if command -v docker exec -u root phpfpm82 /tmp/composer/vendor/bin/phpcs /dev/null 21; then echo 开始执行phpCodeSniffer; else docker exec -u root phpfpm composer global require --dev squizlabs/php_codesniffer; fi#执行phpcs生成分析报告
docker exec phpfpm /tmp/composer/vendor/bin/phpcs --standardPSR12 --report-checkstyle/workpath/checkstyle-result.xml /workpath/app || true
#这里的true是为了避免jenkins因构建错误而结束构建你需要根据实际情况确定是否要这么做
#我这里只需要报告后续通过checkStyle可视化看是否需要修复所以我保留了true#替换生成文件中项目路径
sed -i s/www/jenkins_home/g /workpath/checkstyle-result.xmlCheckStyle将报告可视化
Dashboard -- 项目名称 -- 配置 -- 构建后步骤选择 Record compiler warnings and static analysis results 工具选择 CheckStyle Report File Pattern 填写 checkstyle-result.xml注意此处文件需要和phpcs生成的报告文件名称一致路径会自动检测 Encoding of Report Files 填写 UTF-8
其他静态检测报告后续补充