fix(serialization): Remove legacy BinaryFormatter support
SonarQube Analysis / sonarqube (pull_request) Successful in 4m42s

The `[Serializable]` attribute and corresponding `[OnDeserialized]` methods have been removed from various breakdown classes. This eliminates reliance on `BinaryFormatter`, which is a deprecated and insecure serialization mechanism in modern .NET.

This change also resolves SonarQube rule S5766 warnings by removing the context in which they apply, leading to cleaner and more secure code.
This commit is contained in:
Thom Lamb
2026-05-20 17:44:21 -05:00
parent 3de3b8bf68
commit 2d9148547f
20 changed files with 0 additions and 201 deletions
@@ -1,5 +1,4 @@
using System.Collections;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Strata.SqlTools.SqlBreakdown.Classes;
@@ -10,7 +9,6 @@ namespace Strata.SqlTools.Breakdowns.SqlServer;
/// <summary>
/// Represents a SQL Server stored procedure call breakdown with procedure name and parameters.
/// </summary>
[Serializable]
public class ProcedureBreakdown : SqlBreakdownBase
{
protected readonly StatementParser Parser;
@@ -46,20 +44,6 @@ public class ProcedureBreakdown : SqlBreakdownBase
Parameters = parameters ?? new Dictionary<string, string>();
}
/// <summary>
/// Re-establishes invariants after deserialization, since deserialization bypasses the
/// constructors that normally initialize the procedure name and parameter collection
/// (SonarQube rule S5766).
/// </summary>
/// <param name="context">The streaming context for the deserialization operation.</param>
[OnDeserialized]
private void OnDeserialized(StreamingContext context)
{
RevalidateBreakdownState();
ProcedureName ??= new SqlClause();
Parameters ??= new Dictionary<string, string>();
}
/// <summary>
/// Gets or sets the stored procedure name.
/// </summary>