简体   繁体   English

PHPMD不输出文件结果

[英]PHPMD not outputting file results

I was asked to implement PHPMD at work (as well as PHPCS... another upcoming posted question, I assume). 我被要求在工作中实现PHPMD(以及PHPCS……我想另一个即将发布的问题)。 I am not very Linux-savvy, either. 我也不是非常精通Linux。 Sorry. 抱歉。

I followed the download instructions on PHPMD. 我按照PHPMD上的下载说明进行操作。 I used Composer and got all the dependencies properly (I assume). 我使用了Composer并正确地获得了所有依赖关系(我认为)。 I placed them in the usr/bin directory with full permissions. 我将它们置于具有完全权限的usr / bin目录中。

I tried using the terminal to enter the command line on the documentation page, except with the changes being relevant to my machine and I wanted the output to be a file I can save for documentation. 我尝试使用终端在文档页面上输入命令行,但所做的更改与我的机器相关,并且我希望输出为可以保存为文档的文件。

PHPMD Command PHPMD命令

phpmd sampleFile.php xml codesize --reportfile report.xml

Output File 输出文件

<?xml version="1.0" encoding="UTF-8" ?>
    <pmd version="@project.version@" timestamp="2016-01-28T14:10:47-05:00">
</pmd>

This doesn't look like the response that is shown in the PHPMD documentation . 这看起来不像PHPMD 文档中所示的响应。 Any guesses as to what I did wrong? 关于我做错了什么的猜测吗? I am not sure if I should be looking into something that I did wrong with PHPMD or something that I did wrong with Linux. 我不确定是否应该调查我在PHPMD上做错的事情或在Linux上做错的事情。 I am using a Linux Red Hat v6.7 (Santiago) VM, if you care. 如果您愿意,我正在使用Linux Red Hat v6.7(圣地亚哥)VM。

Thank you! 谢谢!

phpmd does not seem to show any output for scripts that have no functions or classes (pure spaghetti code). 对于没有功能或类的脚本(纯意大利面条代码),phpmd似乎没有显示任何输出。 I wonder if there is a way to enable this? 我想知道是否有办法做到这一点?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM