[CodeFactor] Apply fixes to commit 4a01f03

This commit is contained in:
codefactor-io
2026-03-11 03:35:12 +00:00
parent 4a01f03cb4
commit 567fa89465
63 changed files with 293 additions and 302 deletions
+4 -4
View File
@@ -94,7 +94,7 @@ public class CcorValidationTests
for (int i = 0; i < 200; i++)
{
double val = 100.0 + 10.0 * Math.Sin(2.0 * Math.PI * i / period);
double val = 100.0 + (10.0 * Math.Sin(2.0 * Math.PI * i / period));
ccor.Update(new TValue(DateTime.UtcNow.AddMinutes(i), val), true);
}
@@ -103,7 +103,7 @@ public class CcorValidationTests
$"Sine wave should produce non-trivial phasor: Real={ccor.Real:F4}, Imag={ccor.Imag:F4}");
// R² + I² should be near 1 for a pure tone at the matched frequency
double magnitude = Math.Sqrt(ccor.Real * ccor.Real + ccor.Imag * ccor.Imag);
double magnitude = Math.Sqrt((ccor.Real * ccor.Real) + (ccor.Imag * ccor.Imag));
Assert.True(magnitude > 0.5,
$"Phasor magnitude should be significant for matched sine: {magnitude:F4}");
}
@@ -138,7 +138,7 @@ public class CcorValidationTests
for (int i = 0; i < 200; i++)
{
double val = 100.0 + 10.0 * Math.Sin(2.0 * Math.PI * i / period);
double val = 100.0 + (10.0 * Math.Sin(2.0 * Math.PI * i / period));
ccor.Update(new TValue(DateTime.UtcNow.AddMinutes(i), val), true);
}
@@ -374,7 +374,7 @@ public class CcorValidationTests
for (int i = 0; i < 100; i++)
{
ind.Update(new TValue(t0.AddMinutes(i),
100.0 + 10.0 * Math.Sin(2.0 * Math.PI * i / 20.0)), isNew: true);
100.0 + (10.0 * Math.Sin(2.0 * Math.PI * i / 20.0))), isNew: true);
}
// Anchor bar