Esempio n. 1
0
 public VisionClass(CodeIsland codeIsland, VClass vclass, int x, int y, int r)
 {
     CodeIsland = codeIsland;
     VClass = vclass;
     X = x;
     Y = y;
     R = r;
     InstructionCount = vclass.VMethods.Sum(vm => vm.InstructionCount);
     MaintainabilityIndex = vclass.MaintainabilityIndex;
     CyclomaticComplexity = vclass.CyclomaticComplexity;
     ClassCoupling = vclass.ClassCoupling;
     LinesOfCode = vclass.LinesOfCode;
 }
Esempio n. 2
0
        public VMethod(VClass vclass, MethodDefinition methodDefinition)
        {
            VClass = vclass;
            MethodDefinition = methodDefinition;
            var fn = MethodDefinition.ToString();
            FullName = fn.Substring(fn.IndexOf(' ') + 1);
            if (!MethodDefinition.HasBody)
                return;

            InstructionCount = MethodDefinition.Body.Instructions.Count;
            VClass.InstructionCount += InstructionCount;
            foreach (var instruction in MethodDefinition.Body.Instructions)
                if (instruction.OpCode == OpCodes.Call || instruction.OpCode == OpCodes.Callvirt)
                {
                    var methodCall = instruction.Operand as MethodReference;
                    if (methodCall == null )
                        continue;
                    var name = methodCall.FullName;
                    name = name.Substring(name.IndexOf(' ') + 1);
                    if (!Calling.Contains(name))
                        Calling.Add(name);
                }
        }
Esempio n. 3
0
 public GotoClassCommand(VClass vclass)
 {
     _vclass = vclass;
 }