Skip to content

Commit

Permalink
VCST-234: fix sonar warnings (#75)
Browse files Browse the repository at this point in the history
fix: fix sonar warnings
  • Loading branch information
OlegoO committed Jan 24, 2024
1 parent 647c234 commit 30f31b2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static string ResolveDisplayName(string fullName)
displayName = fullName;
}

return Regex.Replace(displayName, "[A-Z][a-z0-9_]+", "$0 ").Trim();
return Regex.Replace(displayName, "[A-Z][a-z0-9_]+", "$0 ", RegexOptions.Compiled).Trim();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
Expand Down Expand Up @@ -126,14 +125,14 @@ private WebhookSendResponse CreateSendResponse(HttpResponseMessage response, str
{
return new WebhookSendResponse()
{
StatusCode = (int)(response?.StatusCode ?? 0),
StatusCode = (int)response.StatusCode,
ResponseParams = new WebhookHttpParams()
{
Headers = response?.Headers.ToDictionary(x => x.Key, x => string.Join(";", x.Value)) ?? new Dictionary<string, string>(),
Headers = response.Headers.ToDictionary(x => x.Key, x => string.Join(";", x.Value)),
Body = responseString
},
Error = response != null && response.IsSuccessStatusCode ? string.Empty: responseString,
IsSuccessfull = response?.IsSuccessStatusCode ?? false
Error = response.IsSuccessStatusCode ? string.Empty : responseString,
IsSuccessfull = response.IsSuccessStatusCode
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ public static WebhookFeedEntry CreateFeedEntry(WebhookFeedEntryType entryType, s
EventId = eventId,
AttemptCount = 0,
Error = new string(response.Error.Take(1024).ToArray()),
Status = response?.StatusCode ?? 0,
Status = response.StatusCode,
RequestHeaders = GetJsonString(webHook.RequestParams.Headers),
RequestBody = webHook.RequestParams.Body,
ResponseHeaders = GetJsonString(response?.ResponseParams?.Headers),
ResponseBody = response?.ResponseParams?.Body,
ResponseHeaders = GetJsonString(response.ResponseParams?.Headers),
ResponseBody = response.ResponseParams?.Body,
};

return result;
Expand Down

0 comments on commit 30f31b2

Please sign in to comment.