diff --git a/.github/sonar-suppressions.json b/.github/sonar-suppressions.json index acf418c3..403946d1 100644 --- a/.github/sonar-suppressions.json +++ b/.github/sonar-suppressions.json @@ -10,6 +10,10 @@ "id": "S1144", "reason": "Unused private types or members should be removed - false positives on reflection/serialization patterns" }, + { + "id": "S1192", + "reason": "String literals should not be duplicated - guard clause exception messages are inline by .NET convention, not localizable strings" + }, { "id": "S1244", "reason": "Floating point numbers should not be tested for equality - intentional exact comparisons in financial calculations" diff --git a/.github/workflows/Publish.yml b/.github/workflows/Publish.yml index d812be06..1e4afae9 100644 --- a/.github/workflows/Publish.yml +++ b/.github/workflows/Publish.yml @@ -43,7 +43,7 @@ jobs: # ============================================================================== ReSharper_Analysis: runs-on: ubuntu-latest - timeout-minutes: 15 + timeout-minutes: 20 permissions: contents: read actions: write @@ -68,6 +68,9 @@ jobs: - name: Restore dependencies run: dotnet restore + - name: Build solution + run: dotnet build QuanTAlib.slnx --no-restore --configuration Debug --nologo -m:1 + - name: Prepare SARIF directory run: mkdir -p .sarif @@ -80,7 +83,9 @@ jobs: - name: Run ReSharper InspectCode (SARIF) run: | set +e - jb inspectcode QuanTAlib.slnx \ + jb inspectcode lib/quantalib.csproj \ + --no-build \ + --include="**/*.cs" \ --format=sarif \ --output=.sarif/resharper.sarif rc=$? diff --git a/Directory.Build.props b/Directory.Build.props index 27a93cae..26897226 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -73,7 +73,7 @@ - $(NoWarn);S107;S1144;S1244;S1944;S2053;S2245;S2259;S2583;S2589;S3329;S3604;S3655;S3776;S3949;S3966;S4158;S4347;S5773;S6781;MA0007;MA0048;MA0051;MA0076;RCS1123;RCS1159;IDE0007 + $(NoWarn);S107;S1144;S1192;S1244;S1944;S2053;S2245;S2259;S2583;S2589;S3329;S3604;S3655;S3776;S3949;S3966;S4158;S4347;S5773;S6781;MA0007;MA0048;MA0051;MA0076;RCS1123;RCS1159;IDE0007 diff --git a/python/src/Exports.cs b/python/src/Exports.cs index ec488172..82c65de7 100644 --- a/python/src/Exports.cs +++ b/python/src/Exports.cs @@ -1387,13 +1387,13 @@ public static unsafe partial class Exports catch { return StatusCodes.QTL_ERR_INTERNAL; } } - // Eacp: Pattern A (int period, int min, int max, bool useSimd → int) + // Eacp: (int minPeriod, int maxPeriod, int avgLength, bool enhance → int) [UnmanagedCallersOnly(EntryPoint = "qtl_eacp")] - public static int QtlEacp(double* src, int n, double* dst, int period, int minPeriod, int maxPeriod, int useMedian) + public static int QtlEacp(double* src, int n, double* dst, int minPeriod, int maxPeriod, int avgLength, int enhance) { int v = Chk1(src, dst, n); if (v != 0) return v; - v = ChkPeriod(period); if (v != 0) return v; - try { Eacp.Batch(Src(src, n), Dst(dst, n), period, minPeriod, maxPeriod, useMedian != 0); return StatusCodes.QTL_OK; } + v = ChkPeriod(minPeriod); if (v != 0) return v; + try { Eacp.Batch(Src(src, n), Dst(dst, n), minPeriod, maxPeriod, avgLength, enhance != 0); return StatusCodes.QTL_OK; } catch { return StatusCodes.QTL_ERR_INTERNAL; } }