简体   繁体   中英

How can I convert PHP Code Sniffer XML report into HTML?

Can you suggest some method of converting PHP Code Sniffer XML report into HTML page(s). I guess I might need some XSLT translation… Thanks in advance for the advice.

几天前我在我的博客上发布了XSLT样式表: http//phpdojo.blogspot.com/2010/12/converting-phpcodesniffer-xml-report.html包括新类型的报告:xsl。

Just to add: If you run phpcs through Jenkins, then you can output the report in 'checkstyle' format.

phpcs --report=checkstyle --report-file=/phpcs/out.xml

Then configure your Jenkins job to parse the output using that file.

Here's the plugin:

https://wiki.jenkins-ci.org/display/JENKINS/Checkstyle+Plugin

Here's some output samples:

在此输入图像描述在此输入图像描述

XSLT is quite cumbersome to write, very few people I know can do it well; you can instead parse the XML in a PHP script and spit out HTML.

CodeSniffer can also output its report as a CSV file - if that's easier for you to parse, use that instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM