docs: complete XML doc coverage (returns, summaries, inheritdoc)
Resolve all 622 issues flagged by the enhanced CommentChecker: add missing <returns> tags (incl. the standard phrasing on non-generic Task methods), add missing <summary> tags, and replace misused/redundant <inheritdoc/> on members that override or implement nothing with real documentation. Documentation-only — no behavior change; solution builds clean.
This commit is contained in:
@@ -71,6 +71,11 @@ internal static class AuditRedactionPrimitives
|
||||
/// field is over-redacted with <see cref="RedactorErrorMarker"/> and
|
||||
/// <paramref name="onFailure"/> is invoked.
|
||||
/// </summary>
|
||||
/// <param name="json">The raw JSON string to redact; null passes through as null.</param>
|
||||
/// <param name="redactList">Header names (case-insensitive) whose values should be replaced.</param>
|
||||
/// <param name="logger">Logger for warning diagnostics on redactor faults.</param>
|
||||
/// <param name="onFailure">Callback invoked when the redactor stage faults; used to increment health counters.</param>
|
||||
/// <returns>The re-serialized JSON with redacted header values, the original string if nothing was redacted, or <see cref="RedactorErrorMarker"/> on fault.</returns>
|
||||
public static string? RedactHeaders(
|
||||
string? json,
|
||||
IList<string> redactList,
|
||||
@@ -152,6 +157,11 @@ internal static class AuditRedactionPrimitives
|
||||
/// with <see cref="RedactorErrorMarker"/> and <paramref name="onFailure"/>
|
||||
/// is invoked — the user-facing action is never aborted.
|
||||
/// </summary>
|
||||
/// <param name="value">The string to redact; null passes through as null.</param>
|
||||
/// <param name="regexes">Compiled body-redaction regexes applied in order.</param>
|
||||
/// <param name="logger">Logger for warning diagnostics on redactor faults.</param>
|
||||
/// <param name="onFailure">Callback invoked when a regex match faults; used to increment health counters.</param>
|
||||
/// <returns>The value with all regex matches replaced by <see cref="RedactedMarker"/>, or <see cref="RedactorErrorMarker"/> on fault.</returns>
|
||||
public static string? RedactBody(
|
||||
string? value,
|
||||
IReadOnlyList<Regex> regexes,
|
||||
@@ -192,6 +202,11 @@ internal static class AuditRedactionPrimitives
|
||||
/// is over-redacted with <see cref="RedactorErrorMarker"/> and
|
||||
/// <paramref name="onFailure"/> is invoked.
|
||||
/// </summary>
|
||||
/// <param name="json">The raw JSON string to redact; null passes through as null.</param>
|
||||
/// <param name="paramNameRegex">Compiled regex matched against each SQL parameter name.</param>
|
||||
/// <param name="logger">Logger for warning diagnostics on redactor faults.</param>
|
||||
/// <param name="onFailure">Callback invoked when the redactor stage faults; used to increment health counters.</param>
|
||||
/// <returns>The re-serialized JSON with matched parameter values replaced by <see cref="RedactedMarker"/>, the original string if no parameters matched, or <see cref="RedactorErrorMarker"/> on fault.</returns>
|
||||
public static string? RedactSqlParameters(
|
||||
string? json,
|
||||
Regex paramNameRegex,
|
||||
@@ -277,6 +292,10 @@ internal static class AuditRedactionPrimitives
|
||||
/// setting <paramref name="truncated"/> to <c>true</c> when the value was
|
||||
/// shortened. Null passes through as null.
|
||||
/// </summary>
|
||||
/// <param name="value">The string to truncate; null passes through as null.</param>
|
||||
/// <param name="cap">Maximum number of UTF-8 bytes to retain.</param>
|
||||
/// <param name="truncated">Set to <c>true</c> when the value was shortened; unchanged otherwise.</param>
|
||||
/// <returns>The truncated string, the original string if within the cap, or <c>null</c> if the input was null.</returns>
|
||||
public static string? TruncateField(string? value, int cap, ref bool truncated)
|
||||
{
|
||||
if (value is null)
|
||||
@@ -299,6 +318,9 @@ internal static class AuditRedactionPrimitives
|
||||
/// (<c>byte & 0xC0 == 0x80</c>), and decodes the resulting prefix —
|
||||
/// guaranteeing the returned string never splits a multi-byte sequence.
|
||||
/// </summary>
|
||||
/// <param name="value">The string to truncate.</param>
|
||||
/// <param name="capBytes">Maximum number of UTF-8 bytes in the returned string.</param>
|
||||
/// <returns>The truncated string guaranteed not to split a multi-byte UTF-8 sequence, or the original string if within the cap.</returns>
|
||||
public static string TruncateUtf8(string value, int capBytes)
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
|
||||
@@ -35,6 +35,8 @@ internal sealed class AuditRegexCache
|
||||
private readonly ConcurrentDictionary<string, CompiledRegex> _cache = new();
|
||||
private readonly ILogger _logger;
|
||||
|
||||
/// <summary>Initializes the cache with the logger used to report compile failures.</summary>
|
||||
/// <param name="logger">Logger for recording invalid or slow-compile pattern warnings.</param>
|
||||
public AuditRegexCache(ILogger logger) => _logger = logger;
|
||||
|
||||
/// <summary>
|
||||
@@ -44,6 +46,9 @@ internal sealed class AuditRegexCache
|
||||
/// compile time "invalid"); the failure is logged once and the sentinel
|
||||
/// cache entry prevents repeat compile attempts.
|
||||
/// </summary>
|
||||
/// <param name="pattern">The regex pattern string to look up or compile.</param>
|
||||
/// <param name="regex">The compiled <see cref="Regex"/>, or <c>null</c> if the pattern is invalid.</param>
|
||||
/// <returns><c>true</c> if the pattern compiled successfully; <c>false</c> if it is invalid or too slow to compile.</returns>
|
||||
public bool TryGet(string pattern, out Regex? regex)
|
||||
{
|
||||
var entry = _cache.GetOrAdd(pattern, Compile);
|
||||
@@ -88,8 +93,11 @@ internal sealed class AuditRegexCache
|
||||
{
|
||||
public static readonly CompiledRegex Invalid = new(null);
|
||||
|
||||
/// <summary>The compiled regex, or <c>null</c> when this entry represents an invalid pattern.</summary>
|
||||
public Regex? Regex { get; }
|
||||
|
||||
/// <summary>Initializes the entry with the compiled regex (or <c>null</c> for the invalid sentinel).</summary>
|
||||
/// <param name="regex">The compiled <see cref="Regex"/>, or <c>null</c> for a failed compile.</param>
|
||||
public CompiledRegex(Regex? regex) => Regex = regex;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user