February 2, 2012

PHPCodeSniffer HTML Report?

Question by Annie B.

Does PHPCodeSniffer generates HTML Report?

If not? How?

Currently, I can run PHPCodeSniffer but it only produce XML file and displays result in the terminal.

How can i make produce HTML Report like the coverage and unit test report in phpunit.

Currently i use PHPCheckStyle since it produces html report, but i want also to try PHPCodeSniffer to know which is best.

Thanks

Answer by Matthieu

Another solution (but maybe not the simplest one) is to use a continuous integration system that provides PHP code sniffer integration.

For example, phpUnderControl provides a nice interface to see the report.

phpUnderControl

Answer by Starx

HTML Reporting is not provided yet. However there is a workaround to get the job done.

You can export the report to XML and read the data with DOM Parser and generate an HTML version on your own. Here is a quick tutorial to get you started.

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!