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