From 9e68ba1ab9976880c2c4121ec1b7ab87525c12bf Mon Sep 17 00:00:00 2001 From: BarryNorfolk Date: Thu, 30 Jul 2026 21:22:42 +0200 Subject: [PATCH 01/11] Add editor configs that enforce analyzer diagnostics --- Content.Client/_DVA/.editorconfig | 5 +++++ Content.Server/_DVA/.editorconfig | 5 +++++ Content.Shared/_DVA/.editorconfig | 6 ++++++ 3 files changed, 16 insertions(+) create mode 100644 Content.Client/_DVA/.editorconfig create mode 100644 Content.Server/_DVA/.editorconfig create mode 100644 Content.Shared/_DVA/.editorconfig diff --git a/Content.Client/_DVA/.editorconfig b/Content.Client/_DVA/.editorconfig new file mode 100644 index 0000000000..8ab22bec06 --- /dev/null +++ b/Content.Client/_DVA/.editorconfig @@ -0,0 +1,5 @@ +root = false + +[*.cs] +dotnet_analyzer_diagnostic.severity = error +dotnet_diagnostic.CA1707.severity = none # Ignore: Remove underscores from namespace name diff --git a/Content.Server/_DVA/.editorconfig b/Content.Server/_DVA/.editorconfig new file mode 100644 index 0000000000..8ab22bec06 --- /dev/null +++ b/Content.Server/_DVA/.editorconfig @@ -0,0 +1,5 @@ +root = false + +[*.cs] +dotnet_analyzer_diagnostic.severity = error +dotnet_diagnostic.CA1707.severity = none # Ignore: Remove underscores from namespace name diff --git a/Content.Shared/_DVA/.editorconfig b/Content.Shared/_DVA/.editorconfig new file mode 100644 index 0000000000..e84722bb7d --- /dev/null +++ b/Content.Shared/_DVA/.editorconfig @@ -0,0 +1,6 @@ +root = false + +[*.cs] +dotnet_analyzer_diagnostic.severity = error +dotnet_diagnostic.CA1707.severity = none # Ignore: Remove underscores from namespace name +dotnet_diagnostic.CA1716.severity = none # Ignore: Rename to no longer conflict with Shared (Reserved wording) From 022dff39c99fbd3f3295cb7a50150e930dafc313 Mon Sep 17 00:00:00 2001 From: BarryNorfolk Date: Thu, 30 Jul 2026 21:50:41 +0200 Subject: [PATCH 02/11] Ignore invisible instance fields --- Content.Client/_DVA/.editorconfig | 1 + Content.Server/_DVA/.editorconfig | 1 + Content.Shared/_DVA/.editorconfig | 1 + 3 files changed, 3 insertions(+) diff --git a/Content.Client/_DVA/.editorconfig b/Content.Client/_DVA/.editorconfig index 8ab22bec06..6ea27956ff 100644 --- a/Content.Client/_DVA/.editorconfig +++ b/Content.Client/_DVA/.editorconfig @@ -3,3 +3,4 @@ root = false [*.cs] dotnet_analyzer_diagnostic.severity = error dotnet_diagnostic.CA1707.severity = none # Ignore: Remove underscores from namespace name +dotnet_diagnostic.CA1051.severity = none # Ignore: Do not declare invisible instance fields diff --git a/Content.Server/_DVA/.editorconfig b/Content.Server/_DVA/.editorconfig index 8ab22bec06..6ea27956ff 100644 --- a/Content.Server/_DVA/.editorconfig +++ b/Content.Server/_DVA/.editorconfig @@ -3,3 +3,4 @@ root = false [*.cs] dotnet_analyzer_diagnostic.severity = error dotnet_diagnostic.CA1707.severity = none # Ignore: Remove underscores from namespace name +dotnet_diagnostic.CA1051.severity = none # Ignore: Do not declare invisible instance fields diff --git a/Content.Shared/_DVA/.editorconfig b/Content.Shared/_DVA/.editorconfig index e84722bb7d..92d077cc33 100644 --- a/Content.Shared/_DVA/.editorconfig +++ b/Content.Shared/_DVA/.editorconfig @@ -3,4 +3,5 @@ root = false [*.cs] dotnet_analyzer_diagnostic.severity = error dotnet_diagnostic.CA1707.severity = none # Ignore: Remove underscores from namespace name +dotnet_diagnostic.CA1051.severity = none # Ignore: Do not declare invisible instance fields dotnet_diagnostic.CA1716.severity = none # Ignore: Rename to no longer conflict with Shared (Reserved wording) From e10ea3eec4c4d141e61381e3f23519ef4a4b5d16 Mon Sep 17 00:00:00 2001 From: BarryNorfolk Date: Thu, 30 Jul 2026 21:52:04 +0200 Subject: [PATCH 03/11] Set IsCriticalOrDead to static --- .../_DVA/Medical/CrewMonitoring/DVCrewMonitorAlertSystem.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Server/_DVA/Medical/CrewMonitoring/DVCrewMonitorAlertSystem.cs b/Content.Server/_DVA/Medical/CrewMonitoring/DVCrewMonitorAlertSystem.cs index 027be85584..3d4de0a080 100644 --- a/Content.Server/_DVA/Medical/CrewMonitoring/DVCrewMonitorAlertSystem.cs +++ b/Content.Server/_DVA/Medical/CrewMonitoring/DVCrewMonitorAlertSystem.cs @@ -77,8 +77,8 @@ private void Alert(Entity monitor) monitor.Comp.LastAlert = _timing.CurTime; } - private bool IsCriticalOrDead(SuitSensorStatus status) + private static bool IsCriticalOrDead(SuitSensorStatus status) { return !status.IsAlive || status.DamagePercentage >= 1f; } -} \ No newline at end of file +} From 141c176e1ae5f18b0046bb5b7373c7162d5f72d2 Mon Sep 17 00:00:00 2001 From: BarryNorfolk Date: Thu, 30 Jul 2026 22:01:58 +0200 Subject: [PATCH 04/11] Ignore braces on If statements --- Content.Client/_DVA/.editorconfig | 1 + Content.Server/_DVA/.editorconfig | 1 + Content.Shared/_DVA/.editorconfig | 1 + 3 files changed, 3 insertions(+) diff --git a/Content.Client/_DVA/.editorconfig b/Content.Client/_DVA/.editorconfig index 6ea27956ff..3fd44f1cb3 100644 --- a/Content.Client/_DVA/.editorconfig +++ b/Content.Client/_DVA/.editorconfig @@ -4,3 +4,4 @@ root = false dotnet_analyzer_diagnostic.severity = error dotnet_diagnostic.CA1707.severity = none # Ignore: Remove underscores from namespace name dotnet_diagnostic.CA1051.severity = none # Ignore: Do not declare invisible instance fields +dotnet_diagnostic.IDE0011.severity = none # Ignore: Add braces diff --git a/Content.Server/_DVA/.editorconfig b/Content.Server/_DVA/.editorconfig index 6ea27956ff..3fd44f1cb3 100644 --- a/Content.Server/_DVA/.editorconfig +++ b/Content.Server/_DVA/.editorconfig @@ -4,3 +4,4 @@ root = false dotnet_analyzer_diagnostic.severity = error dotnet_diagnostic.CA1707.severity = none # Ignore: Remove underscores from namespace name dotnet_diagnostic.CA1051.severity = none # Ignore: Do not declare invisible instance fields +dotnet_diagnostic.IDE0011.severity = none # Ignore: Add braces diff --git a/Content.Shared/_DVA/.editorconfig b/Content.Shared/_DVA/.editorconfig index 92d077cc33..4c21ef7205 100644 --- a/Content.Shared/_DVA/.editorconfig +++ b/Content.Shared/_DVA/.editorconfig @@ -4,4 +4,5 @@ root = false dotnet_analyzer_diagnostic.severity = error dotnet_diagnostic.CA1707.severity = none # Ignore: Remove underscores from namespace name dotnet_diagnostic.CA1051.severity = none # Ignore: Do not declare invisible instance fields +dotnet_diagnostic.IDE0011.severity = none # Ignore: Add braces dotnet_diagnostic.CA1716.severity = none # Ignore: Rename to no longer conflict with Shared (Reserved wording) From 3a953998a9f6b6b12cb40ba1c4653aed5c822e83 Mon Sep 17 00:00:00 2001 From: BarryNorfolk Date: Thu, 30 Jul 2026 22:15:17 +0200 Subject: [PATCH 05/11] Set DescribeInner to readonly --- Content.Server/_DVA/Glimmer/DVGlimmerCommands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/_DVA/Glimmer/DVGlimmerCommands.cs b/Content.Server/_DVA/Glimmer/DVGlimmerCommands.cs index 0eb11cbd86..5edbf4591e 100644 --- a/Content.Server/_DVA/Glimmer/DVGlimmerCommands.cs +++ b/Content.Server/_DVA/Glimmer/DVGlimmerCommands.cs @@ -58,7 +58,7 @@ public EntityUid Get(IInvocationContext ctx) public record struct GlimmerMissingError : IConError { - public FormattedMessage DescribeInner() + public readonly FormattedMessage DescribeInner() { return FormattedMessage.FromMarkupOrThrow("This command doesn't function if there's no glimmer. Is the round started?"); } From 04dd94a90b27065d6938418e6a4c0ad8b3130ec0 Mon Sep 17 00:00:00 2001 From: BarryNorfolk Date: Thu, 30 Jul 2026 22:15:35 +0200 Subject: [PATCH 06/11] Capture unused variables to appease the analyzer --- Content.Server/_DVA/Glimmer/DVGlimmerSpawningSystem.cs | 2 +- .../_DVA/Medical/CrewMonitoring/DVCrewMonitorAlertSystem.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Content.Server/_DVA/Glimmer/DVGlimmerSpawningSystem.cs b/Content.Server/_DVA/Glimmer/DVGlimmerSpawningSystem.cs index d5d6af5de7..9d10e2989c 100644 --- a/Content.Server/_DVA/Glimmer/DVGlimmerSpawningSystem.cs +++ b/Content.Server/_DVA/Glimmer/DVGlimmerSpawningSystem.cs @@ -21,7 +21,7 @@ public override void Initialize() private void OnPostGameMapLoad(PostGameMapLoad ev) { var ent = Spawn(); - AddComp(ent); + _ = AddComp(ent); _pvsOverride.AddGlobalOverride(ent); } } diff --git a/Content.Server/_DVA/Medical/CrewMonitoring/DVCrewMonitorAlertSystem.cs b/Content.Server/_DVA/Medical/CrewMonitoring/DVCrewMonitorAlertSystem.cs index 3d4de0a080..36e3eab3ee 100644 --- a/Content.Server/_DVA/Medical/CrewMonitoring/DVCrewMonitorAlertSystem.cs +++ b/Content.Server/_DVA/Medical/CrewMonitoring/DVCrewMonitorAlertSystem.cs @@ -49,7 +49,7 @@ private void OnPacketReceived(Entity ent, ref Devi .Intersect(ent.Comp.AlertedSensors); // Find "alerted" people that are healthy if (staleAlerts.Any()) - ent.Comp.AlertedSensors.RemoveWhere(alert => staleAlerts.Contains(alert)); + _ = ent.Comp.AlertedSensors.RemoveWhere(alert => staleAlerts.Contains(alert)); // alert is still on cooldown, defer checking if we should alert if (ent.Comp.LastAlert + ent.Comp.AlertCooldown > _timing.CurTime) @@ -73,7 +73,7 @@ private void OnPacketReceived(Entity ent, ref Devi private void Alert(Entity monitor) { var audioParams = AudioParams.Default.WithVolume(-2f).WithMaxDistance(4f); - _audio.PlayPvs(monitor.Comp.AlertSound, monitor.Owner, audioParams); + _ = _audio.PlayPvs(monitor.Comp.AlertSound, monitor.Owner, audioParams); monitor.Comp.LastAlert = _timing.CurTime; } From 8d6af6a021ffa75d234ab8741c5066771aae03a9 Mon Sep 17 00:00:00 2001 From: BarryNorfolk Date: Thu, 30 Jul 2026 22:15:42 +0200 Subject: [PATCH 07/11] Remove unused import --- Content.Shared/_DVA/Glimmer/DVGlimmerComponent.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Content.Shared/_DVA/Glimmer/DVGlimmerComponent.cs b/Content.Shared/_DVA/Glimmer/DVGlimmerComponent.cs index f7071144d0..81405ff30f 100644 --- a/Content.Shared/_DVA/Glimmer/DVGlimmerComponent.cs +++ b/Content.Shared/_DVA/Glimmer/DVGlimmerComponent.cs @@ -1,4 +1,3 @@ -using System.Linq; using Content.Shared._DVA.Utility; using Robust.Shared.GameStates; using Robust.Shared.Serialization; From 3d3fde3228fa0f377b457a967502f1916a318c55 Mon Sep 17 00:00:00 2001 From: BarryNorfolk Date: Thu, 30 Jul 2026 22:17:36 +0200 Subject: [PATCH 08/11] Remove unused _net --- Content.Shared/_DVA/Glimmer/DVGlimmerSystem.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/Content.Shared/_DVA/Glimmer/DVGlimmerSystem.cs b/Content.Shared/_DVA/Glimmer/DVGlimmerSystem.cs index 953010ad2c..dc104437a2 100644 --- a/Content.Shared/_DVA/Glimmer/DVGlimmerSystem.cs +++ b/Content.Shared/_DVA/Glimmer/DVGlimmerSystem.cs @@ -1,7 +1,6 @@ using System.Linq; using JetBrains.Annotations; using Robust.Shared.GameStates; -using Robust.Shared.Network; using Robust.Shared.Serialization; namespace Content.Shared._DVA.Glimmer; @@ -11,8 +10,6 @@ namespace Content.Shared._DVA.Glimmer; /// public sealed partial class DVGlimmerSystem : EntitySystem { - [Dependency] private INetManager _net = default!; - /// /// The current glimmer of the round. /// From fd5359c08d31e4d7eff755f02d48d0ee931832d7 Mon Sep 17 00:00:00 2001 From: BarryNorfolk Date: Thu, 30 Jul 2026 22:18:02 +0200 Subject: [PATCH 09/11] Use expression body for property --- Content.Shared/_DVA/Glimmer/DVGlimmerSystem.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Content.Shared/_DVA/Glimmer/DVGlimmerSystem.cs b/Content.Shared/_DVA/Glimmer/DVGlimmerSystem.cs index dc104437a2..d658431122 100644 --- a/Content.Shared/_DVA/Glimmer/DVGlimmerSystem.cs +++ b/Content.Shared/_DVA/Glimmer/DVGlimmerSystem.cs @@ -30,10 +30,7 @@ public int Glimmer /// The current glimmer tier of the round. /// [PublicAPI] - public GlimmerTier GlimmerTier - { - get => Entity?.Comp.Tier ?? GlimmerTier.Minimal; - } + public GlimmerTier GlimmerTier => Entity?.Comp.Tier ?? GlimmerTier.Minimal; /// /// Returns the current glimmer entity for the round, if any. From 9e3bd178da8ea801b0e5e507b76d1aa08d0cb987 Mon Sep 17 00:00:00 2001 From: BarryNorfolk Date: Thu, 30 Jul 2026 22:23:11 +0200 Subject: [PATCH 10/11] Use some more return values --- .../CrewMonitoring/CrewMonitoringShuttleControl.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Content.Client/_DVA/CrewMonitoring/CrewMonitoringShuttleControl.cs b/Content.Client/_DVA/CrewMonitoring/CrewMonitoringShuttleControl.cs index 4e0a226e67..d10950386b 100644 --- a/Content.Client/_DVA/CrewMonitoring/CrewMonitoringShuttleControl.cs +++ b/Content.Client/_DVA/CrewMonitoring/CrewMonitoringShuttleControl.cs @@ -57,7 +57,9 @@ protected override void Draw(DrawingHandleScreen handle) var mapPos = _transform.ToMapCoordinates(coordinates); var ourEntRot = Angle.Zero; var ourEntMatrix = Matrix3Helpers.CreateTransform(_transform.GetWorldPosition(xform), ourEntRot); - Matrix3x2.Invert(ourEntMatrix, out var worldToShuttle); + if (!Matrix3x2.Invert(ourEntMatrix, out var worldToShuttle)) + return; + var shuttleToView = Matrix3x2.CreateScale(new Vector2(MinimapScale, -MinimapScale)) * Matrix3x2.CreateTranslation(MidPointVector); var worldToView = worldToShuttle * shuttleToView; @@ -73,7 +75,8 @@ protected override void Draw(DrawingHandleScreen handle) continue; var body = bodyQuery.GetComponent(grid); - iffQuery.TryComp(grid, out var iff); + if (iffQuery.TryComp(grid, out var iff)) + continue; if (!_shuttles.CanDraw(grid, body, iff)) continue; @@ -138,10 +141,13 @@ protected override void KeyBindUp(GUIBoundKeyEventArgs args) var ourEntRot = Angle.Zero; var ourEntMatrix = Matrix3Helpers.CreateTransform(_transform.GetWorldPosition(xform), ourEntRot); - Matrix3x2.Invert(ourEntMatrix, out var worldToShuttle); + if (!Matrix3x2.Invert(ourEntMatrix, out var worldToShuttle)) + return; + var shuttleToView = Matrix3x2.CreateScale(new Vector2(MinimapScale, -MinimapScale)) * Matrix3x2.CreateTranslation(MidPointVector); var worldToView = worldToShuttle * shuttleToView; - Matrix3x2.Invert(worldToView, out var viewToWorld); + if (!Matrix3x2.Invert(worldToView, out var viewToWorld)) + return; if (args.Function == EngineKeyFunctions.UIClick) { From 276f950b533b8a00392dde67341a2f5404b75796 Mon Sep 17 00:00:00 2001 From: BarryNorfolk Date: Thu, 30 Jul 2026 22:25:41 +0200 Subject: [PATCH 11/11] Simplify container initialisation --- .../_DVA/CrewMonitoring/CrewMonitoringShuttleControl.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Client/_DVA/CrewMonitoring/CrewMonitoringShuttleControl.cs b/Content.Client/_DVA/CrewMonitoring/CrewMonitoringShuttleControl.cs index d10950386b..74680f53e2 100644 --- a/Content.Client/_DVA/CrewMonitoring/CrewMonitoringShuttleControl.cs +++ b/Content.Client/_DVA/CrewMonitoring/CrewMonitoringShuttleControl.cs @@ -22,7 +22,7 @@ public sealed partial class DVCrewMonitoringShuttleControl : BaseShuttleControl public EntityUid? Owner; public NavMapControl? NavMap; - private List> _grids = new(); + private List> _grids = []; public DVCrewMonitoringShuttleControl() : base(64f, 256f, 256f) {