Skip to content

Resolve remaining SonarCloud findings - #62

Merged
Malcolmnixon merged 1 commit into
mainfrom
fix/sonarcloud-followup
Oct 18, 2026
Merged

Malcolmnixon merged 1 commit into
mainfrom
fix/sonarcloud-followup

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

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.

- 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>
Copilot AI lite review requested due to automatic review settings October 18, 2026 20:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants