admin管理员组

文章数量:1561874

提交代码,报错:Refactor this function to reduce its Cognitive Complexity from 40 to the 30 allowed

降低认知复杂度sonar :Cognitive Complexity of functions should not be too high

1. 尽量减少打断线性代码执行的语句(如if else 、for、catch), 多层嵌套语句

2. 用三目运算符替代 if else. 如果没有else分支,不用再特意替换成三目运算符

3.多层嵌套的语句 拆出来,拆成方法

本文标签: ReduceCognitiveRefactorfunctionallowed