1
0
mirror of https://github.com/chylex/Minecraft-Phantom-Panel.git synced 2025-05-07 00:34:03 +02:00

Fix or suppress several ReSharper warnings

This commit is contained in:
chylex 2022-10-19 13:11:37 +02:00
parent f5e01716ed
commit 69f3fbcbf4
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548
6 changed files with 12 additions and 3 deletions
Agent/Phantom.Agent.Services/Instances
Common/Phantom.Common.Data/Minecraft
Server
Phantom.Server.Database/Entities
Phantom.Server.Web.Components/Utils

View File

@ -53,6 +53,6 @@ sealed class PortManager {
ServerPortNotAllowed,
ServerPortAlreadyInUse,
RconPortNotAllowed,
RconPortAlreadyInUse,
RconPortAlreadyInUse
}
}

View File

@ -7,7 +7,7 @@ public enum MinecraftVersionType : ushort {
Release = 1,
Snapshot = 2,
OldBeta = 3,
OldAlpha = 4,
OldAlpha = 4
}
public static class MinecraftVersionTypes {

View File

@ -1,10 +1,12 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Diagnostics.CodeAnalysis;
using Phantom.Common.Data;
namespace Phantom.Server.Database.Entities;
[Table("Agents", Schema = "agents")]
[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")]
public sealed class AgentEntity {
[Key]
public Guid AgentGuid { get; set; }

View File

@ -8,9 +8,12 @@ using Phantom.Server.Database.Enums;
namespace Phantom.Server.Database.Entities;
[Table("AuditEvents", Schema = "system")]
[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")]
[SuppressMessage("ReSharper", "ClassWithVirtualMembersNeverInherited.Global")]
public class AuditEventEntity : IDisposable {
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
[SuppressMessage("ReSharper", "UnusedMember.Global")]
public long Id { get; set; }
public string? UserId { get; set; }

View File

@ -7,6 +7,7 @@ using Phantom.Common.Data.Minecraft;
namespace Phantom.Server.Database.Entities;
[Table("Instances", Schema = "agents")]
[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")]
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
public sealed class InstanceEntity {
[Key]

View File

@ -1,8 +1,10 @@
using System.Globalization;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
namespace Phantom.Server.Web.Components.Utils;
static class BlazorUtils {
[SuppressMessage("ReSharper", "ConvertIfStatementToReturnStatement")]
public static string? CombineClassNames(IReadOnlyDictionary<string, object>? additionalAttributes, string? classNames) {
if (additionalAttributes is null || !additionalAttributes.TryGetValue("class", out var @class)) {
return classNames;
@ -21,6 +23,7 @@ static class BlazorUtils {
return $"{classAttributeValue} {classNames}";
}
[SuppressMessage("ReSharper", "MergeAndPattern")]
public static bool CombineBooleansWithOr(IReadOnlyDictionary<string, object>? additionalAttributes, string attributeName, bool value) {
return value || (additionalAttributes is not null && additionalAttributes.TryGetValue(attributeName, out var @bool) && @bool is bool and true);
}