本文介绍了计算圈复杂度(流程图)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想算出方法的圈复杂度.

我停留在的位是构造流程图的第一位.

现在说,如果您有5个变量,并且有几个操作(即,我= i;),那么您是否将这些变量和操作中的每一个放入节点,或者可以将它们全部计为一个节点,然后仅创建一个新节点当您遇到if或loop语句时?



1 =变量1
|
2 =变量2
|
3 =变量3
|
4 =变量4
|
5 =变量5
|
6 =操作1
|
7 = if语句的开始
\
8

谢谢

I want to work out the cyclomatic complexity of a method.

The bit I am stuck on is the first bit which is constructing a flow graph.

Now say if you have 5 variables, and a couple of operations (i.e. me = i;) then do you put node for each of these variables and operations, or could you count them all as one node, and then only create a new node when you come to an if or loop statement?

i.e.

1 = variable 1
|
2 = variable 2
|
3 = variable 3
|
4 = variable 4
|
5 = variable 5
|
6 = Operation 1
|
7 = Start of an if statement
\
8

Thanks

推荐答案


这篇关于计算圈复杂度(流程图)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 07:27