fix: resolve SonarCloud and CodeQL code-quality issues - #37
Merged
Conversation
Addresses 33 SonarCloud issues and 1 CodeQL issue flagged in CI run 33139770834: - CA1861 (21x): hoist repeated array literals to static readonly fields - CA1859 (7x): narrow declared types to concrete implementations where safe - CA1816: correct GC.SuppressFinalize usage in AppiumTestBase.Dispose - CA1822: make RollingFileLogger member static (no instance state used) - S107: reduce MainWindowShell constructor parameter count by introducing a MainWindowShellDependencies record, updating all call sites - S3011: avoid reflection-based accessibility bypass in SourceTextDocumentView - S1075: remove hardcoded URI in SourceTextDocumentView - CodeQL cs/useless-cast-to-self in MainWindowShellUiTests Verified via code-review and formal-review (gpt-5.4-mini) across all affected review-sets with no findings. Build clean (0 warnings/errors); all 318 tests pass (9 UiTests + 283 Tests + 26 OtsSoftwareTests), matching the pre-change baseline exactly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fixes cspell CI failure on the NOSONAR suppression comments introduced by the code-quality fix pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Changes BuildFolderChildren's return type from IReadOnlyList<WorkspaceTreeNode> to List<WorkspaceTreeNode>, matching CA1859 guidance. Safe because the only caller assigns it directly to WorkspaceSourceNode.Children (already typed IReadOnlyList<WorkspaceTreeNode>, so the narrower concrete type still satisfies it), and ToTreeNodes (which BuildFolderChildren delegates to in the multi-file-per-folder case) already returns List<WorkspaceTreeNode>. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CI's Test step passes --collect "XPlat Code Coverage;Format=opencover", but no test project referenced coverlet.collector, so dotnet test silently produced zero coverage files and SonarCloud always saw 0% new-code coverage regardless of actual test coverage. This has been the case since before this session's changes (confirmed via git log -S across the whole repo history), not something introduced recently. Adds coverlet.collector 10.0.1 to DemaConsulting.SysML2Workbench.Tests, UiTests, and OtsSoftwareTests (the three in-process test tiers). IntegrationTests is intentionally excluded: it drives the published Desktop app externally via Appium/WebDriver with no ProjectReference, so in-process code coverage collection does not apply to that tier. Verified locally: dotnet test with the same --collect flag CI uses now produces coverage.opencover.xml under each test project's results folder (previously produced none); all 318 tests still pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses 33 SonarCloud issues and 1 CodeQL issue flagged in CI run 33139770834:
Verified via code-review and formal-review (gpt-5.4-mini) across all affected review-sets with no findings. Build clean (0 warnings/errors); all 318 tests pass (9 UiTests + 283 Tests + 26 OtsSoftwareTests), matching the pre-change baseline exactly.