Skip to content

Commit 359204a

Browse files
committed
Remove some issues from codefactor and fix some spelling mistakes
1 parent 402f2c3 commit 359204a

7 files changed

Lines changed: 11 additions & 19 deletions

File tree

API.Test/ProfileTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ public void GetRecipientProfileImgTest()
2121
imgRender.Wait();
2222
imgRender.Result.SaveAsPng("RenderImg.png");
2323

24-
2524
Task<Image> imgDownload = Client.GetMessagePersonProfileImageAsync(new() { ImageUrl = new("https://foundations.projectpythia.org/_images/GitHub-logo.png") }); // A Random non square GitHub image i found
2625
imgDownload.Wait();
2726
imgDownload.Result.SaveAsPng("DownloadImg.png");

WebUntisAPI.Client/Converter/TimeJsonConverter.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ public override void WriteJson(JsonWriter writer, DateTime value, JsonSerializer
1919
writer.WriteValue(timeString);
2020
}
2121
}
22-
}
23-
22+
}

WebUntisAPI.Client/Extensions/ColorExtensions.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace WebUntisAPI.Client.Extensions
1010
public static class ColorExtensions
1111
{
1212
/// <summary>
13-
/// Convert a color instance to the Hexadeciaml format: RRGGBB
13+
/// Convert a color instance to the Hexadecimal format: RRGGBB
1414
/// </summary>
1515
/// <param name="color"></param>
1616
/// <returns>The color string</returns>
@@ -22,11 +22,11 @@ public static string ToHexColorFormat(this Color color)
2222
/// <summary>
2323
/// Convert a color string to the Hexadecimal format: RRGGBB
2424
/// </summary>
25-
/// <param name="color"></param>
25+
/// <param name="_"></param>
2626
/// <param name="colorString">The string to convert</param>
2727
/// <returns>The created color</returns>
2828
/// <exception cref="ArgumentException">Thrown when the <paramref name="colorString"/> isn't in the correct format</exception>
29-
public static Color FromHexColorFormat(this Color color, string colorString)
29+
public static Color FromHexColorFormat(this Color _, string colorString)
3030
{
3131
if (!Regex.IsMatch(colorString, @"[\da-fA-F]{6}"))
3232
throw new ArgumentException("The color string isn't in a correct format", nameof(colorString));
@@ -39,5 +39,4 @@ public static Color FromHexColorFormat(this Color color, string colorString)
3939
return Color.FromArgb(red, green, blue);
4040
}
4141
}
42-
43-
}
42+
}

WebUntisAPI.Client/Models/Messages/Message.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,8 @@ public class Message
7171
[JsonProperty("recipientPersons")]
7272
public List<MessagePerson> Recipients { get; set; } = new List<MessagePerson>();
7373

74-
#pragma warning disable IDE0051
7574
[JsonProperty("recipient")]
7675
private MessagePerson Recipient
77-
#pragma warning restore IDE0051 // Nicht verwendete private Member entfernen
7876
{
7977
get => Recipients.FirstOrDefault();
8078
set => Recipients.Add(value);
@@ -117,7 +115,7 @@ private MessagePerson Recipient
117115
public List<Message> ReplyHistory { get; set; } = new List<Message>();
118116

119117
/// <summary>
120-
/// Informations about a confirmation of the message
118+
/// Information about a confirmation of the message
121119
/// </summary>
122120
/// <remarks>
123121
/// When the message won't request a confirmation and was never confirmed the value is <see langword="null"/>

WebUntisAPI.Client/Models/Messages/MessagePermissions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,4 @@ public class MessagePermissions
5555
[JsonProperty("maxFileCount")]
5656
public int MaxFileCount { get; set; }
5757
}
58-
}
59-
58+
}

WebUntisAPI.Client/WebUntisClient.Messages.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public async Task<MessagePerson[]> GetStaffFilterSearchResultAsync(string search
199199
/// </remarks>
200200
/// <param name="message">The message to confirm</param>
201201
/// <param name="ct">Cancellation token</param>
202-
/// <returns>Informations about the confirm</returns>
202+
/// <returns>Information about the confirm</returns>
203203
/// <exception cref="ObjectDisposedException">Thrown when the instance was disposed</exception>
204204
/// <exception cref="UnauthorizedAccessException">Thrown when you're logged in</exception>
205205
/// <exception cref="HttpRequestException">Thrown when an error happened while the http request</exception>
@@ -645,7 +645,6 @@ public async Task<DraftPreview> CreateDraftAsync(string subject, string content,
645645
writer.WriteStartArray();
646646
writer.WriteEndArray();
647647

648-
649648
writer.WritePropertyName("forbidReply");
650649
writer.WriteValue(forbidReply);
651650

WebUntisAPI.Client/WebUntisClient.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public DateTime SessionBegin
113113
/// Initialize a new client
114114
/// </summary>
115115
/// <param name="clientName">Unique identifier for the client app</param>
116-
/// <param name="timeout">The time in milliseconds until requests will be timeouted</param>
116+
/// <param name="timeout">The time in milliseconds until requests will be timeout</param>
117117
public WebUntisClient(string clientName, TimeSpan timeout)
118118
{
119119
ClientName = clientName;
@@ -234,7 +234,7 @@ public async Task<bool> LoginAsync(string server, string loginName, string usern
234234

235235
_serverUrl = serverUrl;
236236
_loginName = loginName;
237-
_sessionId = responseObject["result"]["sessionId"].ToObject<string>() ?? throw new InvalidDataException("Sesson id was expected");
237+
_sessionId = responseObject["result"]["sessionId"].ToObject<string>() ?? throw new InvalidDataException("Session id was expected");
238238
_loggedIn = true;
239239

240240
// Get the api auth token and the logged in user
@@ -270,7 +270,7 @@ public async Task<bool> LoginAsync(string server, string loginName, string usern
270270
/// </summary>
271271
/// <param name="id">Identifier for the request</param>
272272
/// <param name="ct">Cancellation token</param>
273-
/// <returns>Task for the proccess</returns>
273+
/// <returns>Task for the process</returns>
274274
/// <exception cref="ObjectDisposedException">Thrown when the object is disposed</exception>
275275
public async Task LogoutAsync(string id = "Logout", CancellationToken ct = default)
276276
{
@@ -485,7 +485,6 @@ public async Task ReloadSessionAsync(CancellationToken ct = default)
485485
if (response.StatusCode != HttpStatusCode.OK)
486486
throw new HttpRequestException($"There was an error while the http request (Code: {response.StatusCode}).");
487487

488-
489488
_bearerToken = await response.Content.ReadAsStringAsync();
490489
}
491490

0 commit comments

Comments
 (0)