Static analysis is the practice of analyzing code without actually executing it. The analysis can do a wide variety of checks with different tools. I will focus my attention on the most common tools available for PHP code analysis.
For installing some of the tools in this article you will need to have these packages installed on your system:
1 2 3 4 5 sudo apt-get install php-pear sudo apt-get install php5-xsl sudo apt-get install php5-dev sudo apt-get install default-jdk sudo apt-get install ant
PHP Code Sniffer
PHP Code Sniffer is a tool that helps us make sure our coding style standards are being followed. To install you just need to:
1 sudo pear install PHP_CodeSniffer