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

3

5

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.

Capwell answered 2/12, 2009 at 8:47 Comment(0)
B
5

Few days ago I posted XSLT stylesheet on my blog: http://phpdojo.blogspot.com/2010/12/converting-phpcodesniffer-xml-report.html including new type of report: xsl.

Bari answered 28/12, 2010 at 10:56 Comment(0)
S
4

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:

enter image description here enter image description here

Seton answered 30/8, 2012 at 12:42 Comment(0)
P
0

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.

Pardoes answered 2/12, 2009 at 8:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.