【发布时间】:2018-08-30 07:11:38
【问题描述】:
我有一个遗留代码,其代码复杂度高于 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,但我的管道仍然失败。你以前遇到过这样的问题吗?您知道如何在不更改我的管道设置/配置的情况下解决此问题吗?
【问题讨论】: