小编Imr*_*ran的帖子

IF的循环复杂度((A> B)和(C> D))和IF((A> B)OR(C> D))

我想知道两段代码的圈复杂度,

IF((A>B) AND (C>D)) 
{ a=a+b;c=c+d;}
Run Code Online (Sandbox Code Playgroud)

据我所知,上述代码的圈复杂度= 2 + 1 = 3,

另一个代码

IF((A>B) OR (C>D))
{a=a+b;c=c+d;}
Run Code Online (Sandbox Code Playgroud)

上面代码的复杂性是= 4 + 1 = 5,

上述复杂性是否正确?

cyclomatic-complexity

5
推荐指数
2
解决办法
5272
查看次数

标签 统计

cyclomatic-complexity ×1