Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: fix analyzer warnings (2) #711

Merged
merged 17 commits into from
Jan 12, 2025
Merged

refactor: fix analyzer warnings (2) #711

merged 17 commits into from
Jan 12, 2025

Conversation

vbreuss
Copy link
Member

@vbreuss vbreuss commented Jan 12, 2025

Continuing to fix the analyzer warnings (see #709):

  • Fix CA1859: Change return type of method 'GetFixtureFactory' from 'AutoFixture.IFixture' to 'AutoFixture.Fixture' for improved performance
  • Disable CA1845 once:
    Use span-based 'string.Concat' and 'AsSpan' instead of 'Substring
  • Fix CA1507: Use nameof in place of string literal 'path'
  • Fix CA1869: Avoid creating a new 'JsonSerializerOptions' instance for every serialization operation. Cache and reuse instances instead.
  • Disable CA1835 once
  • Fix CA1822: Member 'Ignore' does not access instance data and can be marked as static
  • Disable MA0110: Use the Regex source generator
  • Disable MA0041: Make property static (deprecated, use CA1822 instead)
  • Avoid MA0036: Make class static
  • Fix MA0001: Use an overload of 'Replace' that has a StringComparison parameter
  • Fix MA0089: Use an overload with char instead of string
  • Fix MA0038: Make method static
  • Disable MA0105: Use the lambda parameters instead of using a closure

@vbreuss vbreuss added the refactor A change or improvement without functional impact label Jan 12, 2025
@vbreuss vbreuss self-assigned this Jan 12, 2025
Copy link

github-actions bot commented Jan 12, 2025

Test Results

     46 files  ±0       46 suites  ±0   21m 56s ⏱️ -20s
 55 196 tests  - 3   52 222 ✅  - 3   2 974 💤 ±0  0 ❌ ±0 
114 815 runs  ±0  102 514 ✅ ±0  12 301 💤 ±0  0 ❌ ±0 

Results for commit 0b912ba. ± Comparison against base commit d62ee8a.

This pull request removes 47538 and adds 47535 tests. Note that renamed tests count towards both.
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path0398bebe-0332-4a7d-89aa-fa360fe40327")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path0674d597-10ca-498b-87fb-608114ac8579")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path32860d06-a419-4074-b7e4-37cd40407439")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path5bd54d55-30a5-4a60-a5db-f5ac3b581f56")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path6e0a017a-753f-4c77-94b9-0af91629796c")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path9cc66f0d-0f67-43d8-a026-1026f37e701f")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathb82f63ea-078d-427b-89ab-3e290fce1765")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathb9cbe10c-80d9-49ec-acad-67be1e97a0bc")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathd17931d0-77c1-46df-b03a-599655c6850e")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path2e318c72-4743-4d9f-847d-a6c1e713fafd")
…
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path0d142914-7276-49e1-af13-95db89745e6f")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path2311b25b-d5df-4fc0-96b5-780f3f0fa1eb")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path44e532eb-0905-4e3f-9f92-0357a60431f7")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path593042a1-1791-404a-aa4d-9b813cb9ebe9")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path5b6d6edf-5d80-4ed3-942b-dae776fe948f")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathae9414e8-adca-401e-bef5-7fd17bff9a89")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathb29b402a-b626-4a65-aa5e-0be1c4cac0a5")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathe04f96f4-bc7f-49ad-9bb8-58a88c4725ba")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathf6e3657c-211a-481b-9d9d-a7e1a8b2c82d")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path13e3b68c-dd7b-43d6-ae3b-7ba6fa6c3882")
…
This pull request removes 2351 skipped tests and adds 2351 skipped tests. Note that renamed tests count towards both.
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path0398bebe-0332-4a7d-89aa-fa360fe40327")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path0674d597-10ca-498b-87fb-608114ac8579")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path32860d06-a419-4074-b7e4-37cd40407439")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path5bd54d55-30a5-4a60-a5db-f5ac3b581f56")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path9cc66f0d-0f67-43d8-a026-1026f37e701f")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathb9cbe10c-80d9-49ec-acad-67be1e97a0bc")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path5e611b38-1dc0-4d5d-b747-f1c102ee075c")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path892eb63b-9a10-46f4-8a33-4f94fbcee594")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path8a2938c8-65c3-4d17-9cd6-21e222e683eb")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path99129624-ac60-4325-b1a2-2f26cc065df1")
…
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path2311b25b-d5df-4fc0-96b5-780f3f0fa1eb")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path5b6d6edf-5d80-4ed3-942b-dae776fe948f")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathae9414e8-adca-401e-bef5-7fd17bff9a89")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathb29b402a-b626-4a65-aa5e-0be1c4cac0a5")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathe04f96f4-bc7f-49ad-9bb8-58a88c4725ba")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.MockFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathf6e3657c-211a-481b-9d9d-a7e1a8b2c82d")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path13e3b68c-dd7b-43d6-ae3b-7ba6fa6c3882")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "path60dd6175-73fe-4ee4-97b8-aab7903270d0")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathb8610eff-9922-4232-bc2c-d7889190634c")
Testably.Abstractions.AccessControl.Tests.DirectoryInfoAclExtensionsTests.RealFileSystemTests ‑ SetAccessControl_ShouldNotUpdateTimes(path: "pathc4a6e9da-5667-40aa-ab3b-16fac3386bfd")
…

♻️ This comment has been updated with latest results.

@vbreuss vbreuss enabled auto-merge (squash) January 12, 2025 12:34
Copy link

github-actions bot commented Jan 12, 2025

👽 Mutation Results

Mutation testing badge

Testably.Abstractions.Testing

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Total Detected Total Undetected Total Mutants
FileSystem/FileStreamMock.cs 10.90% 17 0 0 139 69 0 17 139 225
FileSystem/FileSystemWatcherMock.cs 6.72% 9 3 0 122 60 4 9 125 198
Helpers/Execute.SimulatedPath.cs 25.82% 87 0 0 250 89 2 87 250 428
Helpers/FilePlatformIndependenceExtensions.cs 76.92% 10 2 0 1 3 1 10 3 17
Helpers/PathHelper.cs 76.39% 55 3 0 14 28 1 55 17 101
Statistics/MethodStatistic.cs 33.33% 1 0 0 2 0 0 1 2 3
Statistics/ParameterDescription.cs 93.75% 15 0 0 1 8 12 15 1 36

The final mutation score is 26.54%

Coverage Thresholds: high:80 low:60 break:0

Testably.Abstractions.AccessControl

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Total Detected Total Undetected Total Mutants

The final mutation score is NaN%

Coverage Thresholds: high:80 low:60 break:0

Testably.Abstractions.Compression

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Total Detected Total Undetected Total Mutants

The final mutation score is NaN%

Coverage Thresholds: high:80 low:60 break:0

Testably.Abstractions

Details
File Score Killed Survived Timeout No Coverage Ignored Compile Errors Total Detected Total Undetected Total Mutants

The final mutation score is NaN%

Coverage Thresholds: high:80 low:60 break:0

@vbreuss vbreuss changed the title refactor: fix sonar issues refactor: fix analyzer warnings (2) Jan 12, 2025
@vbreuss vbreuss disabled auto-merge January 12, 2025 14:26
@vbreuss vbreuss enabled auto-merge (squash) January 12, 2025 14:26
@vbreuss vbreuss force-pushed the topic/fix-sonar-issues-2 branch from 7ac3c1a to b65cf8b Compare January 12, 2025 15:11
Copy link

sonarqubecloud bot commented Jan 12, 2025

@vbreuss vbreuss merged commit a2293f2 into main Jan 12, 2025
15 checks passed
@vbreuss vbreuss deleted the topic/fix-sonar-issues-2 branch January 12, 2025 16:02
vbreuss added a commit that referenced this pull request Jan 13, 2025
Continuing to fix the analyzer warnings (see #711)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor A change or improvement without functional impact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant