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
@@ -7,7 +7,6 @@ namespace Strata.SqlTools.SqlBreakdown.Classes;
/// <summary>
/// Base class for SQL query breakdowns that provides common setup/finish clause handling and cloning.
/// </summary>
[Serializable]
public abstract class SqlBreakdownBase : ISqlBreakdown
{
/// <summary>
@@ -48,18 +47,6 @@ public abstract class SqlBreakdownBase : ISqlBreakdown
/// </summary>
public bool IsUsingFinishClause => FinishClauses.Count > 0;
/// <summary>
/// Re-establishes the invariants normally guaranteed by the constructors after the object
/// is reconstructed by deserialization. Deserialization bypasses constructors, so the
/// collection state must be re-validated to avoid a partially-initialized object
/// (SonarQube rule S5766).
/// </summary>
protected void RevalidateBreakdownState()
{
SetupClauses ??= new List<string>();
FinishClauses ??= new ArrayList();
}
/// <summary>
/// Gets the SQL breakdown as a string. Must be implemented by derived classes.
/// </summary>