PHP文件是否有静态代码分析器[如Lint]?

Is there a static code analyzer [like Lint] for PHP files?

是否有用于PHP文件的静态代码分析器?二进制文件本身可以检查语法错误,但是我正在寻找一些可以做更多工作的东西,比如未使用的变量分配、未首先初始化就分配到的数组,以及可能的代码样式警告。开放源码程序是首选,但如果强烈推荐的话,我们可能会说服公司支付一些费用。


(P)Run php in lint-mode from the command line to validate syntax without execution:(p)(P)字母名称(p)(P)3.Higher-level static analyzers include:(p)

  • PHP-SAT-requires http://strategoxt.org/
  • 页:1
  • PHP UU Codesniffer
  • 菲律宾信息探测器
  • Phpstan
  • PHP-CS-fixer

(P)Lower-level analyzers include:(p)

  • PHP UU PARSER
  • Token'uget'all(原始功能)

(P)Runtime analyzers,which are more useful for some things due to phps dynamic nature,include:(p)

  • Xdebug has code coverage and function traces.
  • My php tracer tool used a combined static/dynamic approach,building on XDebug's function traces.

(P)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.(p)(P)Another option is xhprof,which is similar to xdebug,but lighter,making it suitable for production servers.工具包括一个基于菲律宾的界面。(p)


(P)在线菲律宾电灯(p)(P)Phplnet(p)(P)统一变量检查。Link 1 and 2 already seem to do this just fine,though.(p)(P)I can't say I have used any of these integrately,though:(p)


(P)For completeness--also check phpcallgraph.(p)


(P)PHP mess determine is awesome and fast.(p)


(P)I have tried using$PHL and could other tools.然而,我的经验中最好的一个(YMV,of Course)是PFFF Toolset的计划。I heard about PFFF on Quora(http://www.quora.com/is-there-a-good-php-lint-static-analysis-tool)(p)(P)You can compile and install it.There are no nice packages(on my mint debian,I had to install libpcre3-dev,ocaml,Libcairo-Dev,Libgtk-3-Dev and Libgimp 2.0-dev dependencies first)but it should be worth an intsall.(p)(P)The results are reported like(p)字母名称


(P)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 white espace,comments and even variable renamings.a Sample Detection Report for PHP can be found at the wesite.(I'm the author).(p)


(P)The Netbeans ide checks for syntax errors,unusued variables and such.它不是自动的,但小型或中型项目的工作方法很好。(p)


(P)有一个新的工具叫Nwire for php。It is a code exploration plugin for ECIPSE PDT and Zend studio 7.X.It enables real-time code analysis for php and provides the following tools:(p)

  • Code Visification-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.
  • 快速搜索作为你的类型的方法,Fields,file,等等。


(P)PHP(Project mess探测器)and PHP(COPY Paste探测器)as the former part of phpunit(p)


(P)There is Rips-a static source code analyser for vulnerabilities in php scripts.Sources of Rips available at sourceforge.(p)(P)From the Rips site:(p)布尔奇1


(P)有绝对的新工具用于统计编码分析,称PHP分析。(p)(P)Among many types of static analysis it also provides basic auto-fixing functionality,see documentation.(p)(P)Update:PHP-Analyzer is now depressed project but you still can access it on legalcy branch(p)


(P)你可能想尝试与脸书的嬉皮士竞争。(p)(P)这不是对实体项目的统计分析,也可能是你打算为之寻找的东西。(p)(P)https://github.com/facebook/hishop-php(p)