< Summary

Class:SharpHoundCommonLib.OutputTypes.ACE
Assembly:SharpHoundCommonLib
File(s):D:\a\SharpHoundCommon\SharpHoundCommon\src\CommonLib\OutputTypes\ACE.cs
Covered lines:8
Uncovered lines:18
Coverable lines:26
Total lines:37
Line coverage:30.7% (8 of 26)
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    public class ACE {
 545        public string PrincipalSID { get; set; }
 526        public Label PrincipalType { get; set; }
 617        public string RightName { get; set; }
 528        public bool IsInherited { get; set; }
 349        public string InheritanceHash { get; set; }
 10
 111        public override string ToString() {
 112            return $"{PrincipalType} {PrincipalSID} - {RightName} {(IsInherited ? "" : "Not")} Inherited";
 113        }
 14
 015        protected bool Equals(ACE other) {
 016            return PrincipalSID == other.PrincipalSID && PrincipalType == other.PrincipalType &&
 017                   RightName == other.RightName && IsInherited == other.IsInherited;
 018        }
 19
 020        public override bool Equals(object obj) {
 021            if (ReferenceEquals(null, obj)) return false;
 022            if (ReferenceEquals(this, obj)) return true;
 023            if (obj.GetType() != GetType()) return false;
 024            return Equals((ACE)obj);
 025        }
 26
 027        public override int GetHashCode() {
 028            unchecked {
 029                var hashCode = PrincipalSID != null ? PrincipalSID.GetHashCode() : 0;
 030                hashCode = (hashCode * 397) ^ (int)PrincipalType;
 031                hashCode = (hashCode * 397) ^ (RightName != null ? RightName.GetHashCode() : 0);
 032                hashCode = (hashCode * 397) ^ IsInherited.GetHashCode();
 033                return hashCode;
 34            }
 035        }
 36    }
 37}