如何绘制此类的控制流图和Cyclomatic复杂度?

时间:2016-10-16 05:45:48

标签: c# control-flow-graph

public class Wheel{
   public int faceValue;
   public string[ ] fruitNames=new string[5];
   public Wheel(string[ ] fruits){
     for(int i=0; i<fruits.Length; i++){
       fruitNames[i]=fruits[i];
     }
   }

   public void Spin( ) {
     Random rdm=new Random( );
     faceValue=rdm.Next(5);
   }

   public string GetFaceValue( ){
    return fruitNames[faceValue];
   }
 }

如何计算此程序的Cyclomatic复杂度?所以我需要绘制cfg。

0 个答案:

没有答案