Example #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         return(((CodeBag?.GetHashCode() ?? 0) * 397) ^ (Name?.GetHashCode() ?? 0));
     }
 }
Example #2
0
 public static Instance Build(CodeBag codeBag, string name, string location, int linesOfCode)
 {
     return(new Instance(codeBag, name, new Location(location))
     {
         LinesOfCode = linesOfCode
     });
 }
Example #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()
     });
 }
Example #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);
        }
Example #5
0
 public Instance(CodeBag codeBag, string name, Location path) : base(path)
 {
     CodeBag = codeBag;
     Name    = name;
 }
Example #6
0
 public Instance(CodeBag codeBag, string name, Location path)
 {
     CodeBag      = codeBag;
     Name         = name;
     PhysicalPath = path;
 }