예제 #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         return(((CodeBag?.GetHashCode() ?? 0) * 397) ^ (Name?.GetHashCode() ?? 0));
     }
 }
예제 #2
0
 public static Instance Build(CodeBag codeBag, string name, string location, int linesOfCode)
 {
     return(new Instance(codeBag, name, new Location(location))
     {
         LinesOfCode = linesOfCode
     });
 }
예제 #3
0
 public static Instance Build(CodeBag codeBag, string name, string location, int linesOfCode, int complexity, int depthOfInheritance, int coupling, IEnumerable <Member> members)
 {
     return(new Instance(codeBag, name, new Location(location))
     {
         LinesOfCode = linesOfCode,
         CyclomaticComplexity = complexity,
         DepthOfInheritance = depthOfInheritance,
         ClassCoupling = coupling,
         NumberOfMethods = members.Count(),
         Members = members.ToList()
     });
 }
예제 #4
0
        public static Instance Build(CodeBag codeBag, string name, Location location, IEnumerable <Member> members)
        {
            var type = new Instance(codeBag, name, location)
            {
                NumberOfMethods = members.Count(),
                Members         = members.ToList()
            };

            type.Members.ForEach(x =>
            {
                type.LinesOfCode          += x.LinesOfCode;
                type.CyclomaticComplexity += x.CylomaticComplexity;
            });

            return(type);
        }
예제 #5
0
 public Instance(CodeBag codeBag, string name, Location path) : base(path)
 {
     CodeBag = codeBag;
     Name    = name;
 }
예제 #6
0
 public Instance(CodeBag codeBag, string name, Location path)
 {
     CodeBag      = codeBag;
     Name         = name;
     PhysicalPath = path;
 }