在PHP中抑制复杂性警告

时间:2018-03-21 08:47:29

标签: php coding-style bitbucket-pipelines

我有遗留代码,代码的复杂性高于20。 我的管道没有做到这一点。这是来自管道的确切错误消息:

Function's cyclomatic complexity (36) exceeds allowed  maximum of 20

我没有时间重构代码所以,我正在寻找一个临时的解决方案,比如压制/忽略我的文件:

我尝试使用这些:

 * @SuppressWarnings(PHPMD)
 * @SuppressWarnings(PHPMD.CyclomaticComplexity)
 * @SuppressWarnings(PHPMD.LongVariable)
 * @SuppressWarnings(PHPMD.UnusedLocalVariable)

// @codingStandardsIgnoreStart
my code here
// @codingStandardsIgnoreEnd

我也跟着这个article,但我的管道仍然失败。你以前遇到过这样的问题吗?您是否知道如何解决此问题,没有更改我的管道设置/配置?

谢谢

0 个答案:

没有答案