A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2008 yearIs there a static code analyzer [like Lint] for PHP files? - page 1
User InfoPosts
Is there a static code analyzer [like Lint] for PHP files?#1
Is there a static code analyzer for PHP files? The binary itself can check for syntax errors, but I'm looking for something that does more, like unused variable assignments, arrays that are assigned into without being initialized first, and possibly code style warnings. Open-source programs would be preferred, but we might convince the company to pay for something if it's highly recommended.

posted date: 2008-12-18 11:39:00


Re: Is there a static code analyzer [like Lint] for PHP files?#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2008-12-18 11:39:01


Re: Is there a static code analyzer [like Lint] for PHP files?#3
Online PHP lintPHPLintUnitialized variables check. Link 1 and 2 already seem to do this just fine, though.I can't say I have used any of these intensively, though :)

posted date: 2008-12-18 11:48:00


Re: Is there a static code analyzer [like Lint] for PHP files?#4
Run php in lint-mode from the command line to validate syntax without execution:php -l FILENAMEHigher-level static analyzers include:php-sat - Requires http://strategoxt.org/PHP_DependPHP_CodeSnifferHPHPA (discontinued)PHP Mess DetectorLower-level analyzers include:PHP_Parsertoken_get_all (primitive function)Runtime analyzers, which are more useful for some things due to PHPs dynamic nature, include:Xdebug has code coverage and function traces.My PHP Tracer Tool uses a combined static/dynamic approach, building on Xdebug's function traces.The documentation libraries phpdoc and doxygen perform a kind of code analysis. Doxygen, for example, can be configured to render nice inheritance graphs with graphviz.Another option is xhprof, which is similar to xdebug, but lighter, making it suitable for production servers. The tool includes a PHP-based interface.

posted date: 2008-12-18 14:02:00


Re: Is there a static code analyzer [like Lint] for PHP files?#5
For completeness -- also check phpCallGraph.

posted date: 2008-12-19 03:29:00


Re: Is there a static code analyzer [like Lint] for PHP files?#6
PHP PMD (project mess detector) and PHP CPD (copy paste detector) as the former part of PHPUnit

posted date: 2010-01-09 14:45:00


Re: Is there a static code analyzer [like Lint] for PHP files?#7
See Semantic Designs' CloneDR, a "clone detection" tool that finds copy/paste/edited code. It will find exact and near miss code fragments, in spite of whitespace, comments and even variable renamings. A sample detection report for PHP can be found at the wesite. (I'm the author).

posted date: 2010-03-06 23:05:00


Re: Is there a static code analyzer [like Lint] for PHP files?#8
There a new tool called nWire for PHP. It is a code exploration plugin for Eclipse PDT and Zend Studio 7.x. It enables real-time code analysis for PHP and provides the following tools:Code visualization - interactive graphical representation of components and associations.Code navigation - unique navigation view shows all the associations and works with you while you write or read code.Quick search - search as you type for methods, fields, file, etc.

posted date: 2010-06-01 22:50:00


Re: Is there a static code analyzer [like Lint] for PHP files?#9
The NetBeans IDE checks for syntax errors, unusued variables and such. It's not automated, but works fine for small or medium projects.

posted date: 2010-09-02 00:32:00


Re: Is there a static code analyzer [like Lint] for PHP files?#10
+1 for "I'm the author"

posted date: 2011-03-18 08:57:00


Re: Is there a static code analyzer [like Lint] for PHP files?#11
its not answer for question. like answer exist netbeans etc..

posted date: 2011-04-22 04:25:00


Re: Is there a static code analyzer [like Lint] for PHP files?#12
PHP_CodeSniffer looked very nice to me at the start, but I couldn't for the life of me make it NOT show indentations "errors". It seems it ignores the --error-severity option entirely.

posted date: 2011-08-24 02:51:00


select page: « 1 2...»
Copyright ©2008-2017 www.momige.com, all rights reserved.