PHP Mess Detector for Eclipse

做~自己de王妃 提交于 2019-12-03 14:15:55

问题


I have the PTI Eclipse plugin installed.

There is a possibility to change PDepend, CodeSniffer and UnitTest

When I try right-clicking on any file I have a Mess Detector option as well but nothing happens when I click it. And after searching all configuration options, I and can't find any settings for PHPMD.

Does anyone know how to solve it?


回答1:


Old question but since there still seems to be interest in it... I just installed the PTI plugin and there was no mention of PHPMD so I wonder where you get the "Mess Detection" menu item from?

For me actually nothing of PTI works with Eclipse Kepler SR2. Whatever I try just nothing happens.

I'd recommend you MakeGood for running PHPUnit tests in Eclipse and setting up Jenkins (including PHPMD) for your project, it takes a bit time to set up but once it is running it is just great: Template for Jenkins Jobs for PHP Projects




回答2:


When PHPMD runs, it first searches for a default PHP executable which must exist, and this is not set in "PHP Tools" but in "PHP":

Window > Preferences > PHP > PHP Executables > (choose one) > [SET DEFAULT]

But if you had not done this, you would have gotten an error.

At this point PHPMD runs, and places its output in the PHPMD view (not in the Console view), which is usually displayed at the bottom. If it does not appear at all, it might have been closed or ignored. So:

Window > Show View > PHP Tools (Others?) > PHPMD

Another thing that may happen is that PHPMD detects nothing (the view appears but it is empty). In that case you can check the Console view to see what happened. Otherwise, you could try and modify the phpmd.php script which is run by PTI so that it logs what it's doing (you might for example wrap the main routine in a try/catch), either to stdout or by opening a temporary file somewhere on your system.



来源:https://stackoverflow.com/questions/14705389/php-mess-detector-for-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!