Are there any good code-checking tools in PHP?

Source: Internet
Author: User
Tags pear
We often need to check the code when PHP is encoded, which comes with php -lThe feature is too weak to be checked for syntax errors only.
What I need is a checking tool that can be used in a production environment, such as detecting useless variables, or directly using uninitialized variables, and, of course, analyzing potential error codes, and it's best to detect some code style issues. This allows you to control some of the quality issues while developing on a larger scale.

For example, Lint this toolset, in addition to the original C language version, there are other versions of the implementation of CSS Lint, JS Lint and so on, do not know PHP has similar tools.

Reply content:

We often need to check the code when PHP is encoded, which php -l is too weak to be checked for syntax errors.
What I need is a checking tool that can be used in a production environment, such as detecting useless variables, or directly using uninitialized variables, and, of course, analyzing potential error codes, and it's best to detect some code style issues. This allows you to control some of the quality issues while developing on a larger scale.

For example, Lint this toolset, in addition to the original C language version, there are other versions of the implementation of CSS Lint, JS Lint and so on, do not know PHP has similar tools.

Of course.

PHP Mess Detector (http://phpmd.org/)

PHP Project Physical Examination tool, according to the criteria you set (such as the single File code volume, the number of unused parameters, the number of unused methods) to check the PHP code, beyond the set standard when the alarm.

PHP Copy Paste Detector (https://github.com/sebastianbergmann/...)

As the name implies, check for redundant code

PHP Dead Code Detector (https://github.com/sebastianbergmann/...)

Look at the name, check out the methods that have never been called.

PHP Code Sniffer (Http://pear.php.net/package/PHP_CodeS ...)

Old code formatting tools, PHP written, pear package, can be self-hack, can be integrated into the command line. I have been using the PHP Code beautifier, only Windows gui,windows cmd is very difficult to use, has been planning to switch to PHP CS

You can also use Jenkins to integrate the above-mentioned tools in plugins form for continuous integration: http://jenkins-php.org/

You can also use xinc+phing to integrate with the above-mentioned tools to automate the package release after continuous integration: http://code.google.com/p/xinc/

Phplint http://www.icosaedro.it/phplint/

Is that what you want?

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.