mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-05-29 01:34:04 +02:00
Fix or suppress several ReSharper warnings
This commit is contained in:
parent
f5e01716ed
commit
69f3fbcbf4
Agent/Phantom.Agent.Services/Instances
Common/Phantom.Common.Data/Minecraft
Server
Phantom.Server.Database/Entities
Phantom.Server.Web.Components/Utils
@ -53,6 +53,6 @@ sealed class PortManager {
|
|||||||
ServerPortNotAllowed,
|
ServerPortNotAllowed,
|
||||||
ServerPortAlreadyInUse,
|
ServerPortAlreadyInUse,
|
||||||
RconPortNotAllowed,
|
RconPortNotAllowed,
|
||||||
RconPortAlreadyInUse,
|
RconPortAlreadyInUse
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ public enum MinecraftVersionType : ushort {
|
|||||||
Release = 1,
|
Release = 1,
|
||||||
Snapshot = 2,
|
Snapshot = 2,
|
||||||
OldBeta = 3,
|
OldBeta = 3,
|
||||||
OldAlpha = 4,
|
OldAlpha = 4
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class MinecraftVersionTypes {
|
public static class MinecraftVersionTypes {
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using Phantom.Common.Data;
|
using Phantom.Common.Data;
|
||||||
|
|
||||||
namespace Phantom.Server.Database.Entities;
|
namespace Phantom.Server.Database.Entities;
|
||||||
|
|
||||||
[Table("Agents", Schema = "agents")]
|
[Table("Agents", Schema = "agents")]
|
||||||
|
[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")]
|
||||||
public sealed class AgentEntity {
|
public sealed class AgentEntity {
|
||||||
[Key]
|
[Key]
|
||||||
public Guid AgentGuid { get; set; }
|
public Guid AgentGuid { get; set; }
|
||||||
|
@ -8,9 +8,12 @@ using Phantom.Server.Database.Enums;
|
|||||||
namespace Phantom.Server.Database.Entities;
|
namespace Phantom.Server.Database.Entities;
|
||||||
|
|
||||||
[Table("AuditEvents", Schema = "system")]
|
[Table("AuditEvents", Schema = "system")]
|
||||||
|
[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")]
|
||||||
|
[SuppressMessage("ReSharper", "ClassWithVirtualMembersNeverInherited.Global")]
|
||||||
public class AuditEventEntity : IDisposable {
|
public class AuditEventEntity : IDisposable {
|
||||||
[Key]
|
[Key]
|
||||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||||
|
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
|
|
||||||
public string? UserId { get; set; }
|
public string? UserId { get; set; }
|
||||||
|
@ -7,6 +7,7 @@ using Phantom.Common.Data.Minecraft;
|
|||||||
namespace Phantom.Server.Database.Entities;
|
namespace Phantom.Server.Database.Entities;
|
||||||
|
|
||||||
[Table("Instances", Schema = "agents")]
|
[Table("Instances", Schema = "agents")]
|
||||||
|
[SuppressMessage("ReSharper", "AutoPropertyCanBeMadeGetOnly.Global")]
|
||||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||||
public sealed class InstanceEntity {
|
public sealed class InstanceEntity {
|
||||||
[Key]
|
[Key]
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
using System.Globalization;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Globalization;
|
||||||
|
|
||||||
namespace Phantom.Server.Web.Components.Utils;
|
namespace Phantom.Server.Web.Components.Utils;
|
||||||
|
|
||||||
static class BlazorUtils {
|
static class BlazorUtils {
|
||||||
|
[SuppressMessage("ReSharper", "ConvertIfStatementToReturnStatement")]
|
||||||
public static string? CombineClassNames(IReadOnlyDictionary<string, object>? additionalAttributes, string? classNames) {
|
public static string? CombineClassNames(IReadOnlyDictionary<string, object>? additionalAttributes, string? classNames) {
|
||||||
if (additionalAttributes is null || !additionalAttributes.TryGetValue("class", out var @class)) {
|
if (additionalAttributes is null || !additionalAttributes.TryGetValue("class", out var @class)) {
|
||||||
return classNames;
|
return classNames;
|
||||||
@ -21,6 +23,7 @@ static class BlazorUtils {
|
|||||||
return $"{classAttributeValue} {classNames}";
|
return $"{classAttributeValue} {classNames}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[SuppressMessage("ReSharper", "MergeAndPattern")]
|
||||||
public static bool CombineBooleansWithOr(IReadOnlyDictionary<string, object>? additionalAttributes, string attributeName, bool value) {
|
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);
|
return value || (additionalAttributes is not null && additionalAttributes.TryGetValue(attributeName, out var @bool) && @bool is bool and true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user