在此行:
public Map getAll(BusinessTargetPK pkBusinessTargetId) throws Exception
我收到此错误:
NPath复杂度为32,768(最大允许为200)
并且在这一行:
public Map getAll( Long RLE_ROLE_ID ) throws Exception {
我收到此错误:
方法getAll()的NPath复杂度为2048
我完全不知道什么是NPath复杂度及其含义。
有人可以提供建议如何避免这种类型的错误吗?
很好解释:
方法的NPath复杂度是通过该方法的非循环执行路径的数量。
这意味着您应该避免使用带有(嵌套)if / else语句的长函数。
所以我的建议是:
https://modess.io/npath-complexity-cyclomatic-complexity-explained/