< Summary

Class:SharpHoundCommonLib.OutputTypes.ACE
Assembly:SharpHoundCommonLib
File(s):D:\a\SharpHoundCommon\SharpHoundCommon\src\CommonLib\OutputTypes\ACE.cs
Covered lines:7
Uncovered lines:18
Coverable lines:25
Total lines:43
Line coverage:28% (7 of 25)
Covered branches:1
Total branches:18
Branch coverage:5.5% (1 of 18)

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
ToString()50%20100%
Equals(...)0%600%
Equals(...)0%600%
GetHashCode()0%400%

File(s)

D:\a\SharpHoundCommon\SharpHoundCommon\src\CommonLib\OutputTypes\ACE.cs

#LineLine coverage
 1using SharpHoundCommonLib.Enums;
 2
 3namespace SharpHoundCommonLib.OutputTypes
 4{
 5    public class ACE
 6    {
 617        public string PrincipalSID { get; set; }
 598        public Label PrincipalType { get; set; }
 689        public string RightName { get; set; }
 5910        public bool IsInherited { get; set; }
 11
 12        public override string ToString()
 113        {
 114            return $"{PrincipalType} {PrincipalSID} - {RightName} {(IsInherited ? "" : "Not")} Inherited";
 115        }
 16
 17        protected bool Equals(ACE other)
 018        {
 019            return PrincipalSID == other.PrincipalSID && PrincipalType == other.PrincipalType &&
 020                   RightName == other.RightName && IsInherited == other.IsInherited;
 021        }
 22
 23        public override bool Equals(object obj)
 024        {
 025            if (ReferenceEquals(null, obj)) return false;
 026            if (ReferenceEquals(this, obj)) return true;
 027            if (obj.GetType() != GetType()) return false;
 028            return Equals((ACE) obj);
 029        }
 30
 31        public override int GetHashCode()
 032        {
 33            unchecked
 034            {
 035                var hashCode = PrincipalSID != null ? PrincipalSID.GetHashCode() : 0;
 036                hashCode = (hashCode * 397) ^ (int) PrincipalType;
 037                hashCode = (hashCode * 397) ^ (RightName != null ? RightName.GetHashCode() : 0);
 038                hashCode = (hashCode * 397) ^ IsInherited.GetHashCode();
 039                return hashCode;
 40            }
 041        }
 42    }
 43}