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; }
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); } }
public GotoClassCommand(VClass vclass) { _vclass = vclass; }