< Summary

Class:SharpHoundCommonLib.LdapQueryParameters
Assembly:SharpHoundCommonLib
File(s):D:\a\SharpHoundCommon\SharpHoundCommon\src\CommonLib\LdapQueryParameters.cs
Covered lines:21
Uncovered lines:5
Coverable lines:26
Total lines:48
Line coverage:80.7% (21 of 26)
Covered branches:0
Total branches:0

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor()100%10100%
GetQueryInfo()100%10100%

File(s)

D:\a\SharpHoundCommon\SharpHoundCommon\src\CommonLib\LdapQueryParameters.cs

#LineLine coverage
 1using System;
 2using System.DirectoryServices.Protocols;
 3using System.Threading;
 4using SharpHoundCommonLib.Enums;
 5
 6namespace SharpHoundCommonLib {
 7    public class LdapQueryParameters {
 8        private static int _queryIDIndex;
 9        private string _searchBase;
 10        private string _relativeSearchBase;
 4211        public string LDAPFilter { get; set; }
 4212        public SearchScope SearchScope { get; set; } = SearchScope.Subtree;
 7513        public string[] Attributes { get; set; } = Array.Empty<string>();
 3914        public string DomainName { get; set; }
 315        public bool GlobalCatalog { get; set; }
 3716        public bool IncludeSecurityDescriptor { get; set; } = false;
 3717        public bool IncludeDeleted { get; set; } = false;
 118        private int QueryID { get; }
 19
 7420        public LdapQueryParameters() {
 3721            QueryID = _queryIDIndex;
 3722            Interlocked.Increment(ref _queryIDIndex);
 3723        }
 24
 25        public string SearchBase {
 126            get => _searchBase;
 727            set {
 728                _relativeSearchBase = null;
 729                _searchBase = value;
 730            }
 31        }
 32
 33        public string RelativeSearchBase {
 034            get => _relativeSearchBase;
 035            set {
 036                _relativeSearchBase = value;
 037                _searchBase = null;
 038            }
 39        }
 40
 6441        public NamingContext NamingContext { get; set; } = NamingContext.Default;
 42
 43        public string GetQueryInfo()
 144        {
 145            return $"Query Information - Filter: {LDAPFilter}, Domain: {DomainName}, GlobalCatalog: {GlobalCatalog}, ADS
 146        }
 47    }
 48}