Repository navigation
Resolve remaining SonarCloud findings - #62
Merged
Merged
Conversation
- Reduce cognitive complexity of FileNameRules.Escape and ClangAstParser.ParseField - Hoist constant arrays to static readonly fields in GradualDisclosureGenericsTests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues remain, and the reported tests pass.
No open issues 🎉
What changed in this PR
This PR resolves remaining SonarCloud findings by simplifying complexity-heavy code and reusing test arrays.
Changes:
- Extracts reserved-name handling from filename escaping.
- Simplifies boolean AST property parsing and field parsing.
- Hoists repeated expected-value arrays in tests.
| File | Description |
|---|---|
test/ApiMark.DotNet.Tests/DotNetEmitterGradualDisclosureGenericsTests.cs |
Reuses static expected-value arrays. |
src/ApiMark.Cpp/CppAst/ClangAstParser.cs |
Simplifies boolean-property handling and field parsing complexity. |
src/ApiMark.Core/FileNameRules.cs |
Extracts reserved-name guarding from escaping logic. |
Review effort: Lite
This was referenced Oct 19, 2026
This was referenced Oct 26, 2026
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.
Follow-up to #61: reduces cognitive complexity of FileNameRules.Escape and ClangAstParser.ParseField below the S3776 threshold, and hoists constant arrays (CA1861) in DotNetEmitterGradualDisclosureGenericsTests.
Validation: Core, DotNet (net10.0) and Cpp (net10.0, LLVM 22.1.8) tests pass.