PHP Mess Detector for Eclipse

拈花ヽ惹草 提交于 2019-12-03 04:08:21

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

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.

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