test: add C# chained &&/|| deduplication branch coverage - #526
Merged
askpt merged 3 commits intoAug 10, 2026
Merged
Conversation
Adds tests for C# logical operator chain deduplication, mirroring the existing JS/Go/Python/Rust tests. This covers the parent-chain short-circuit branch (return 0 for inner nodes of a same-operator chain) in csharpAnalyzer.ts's getComplexityIncrement, which was previously untested for the C# analyzer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
There was a problem hiding this comment.
Threat detection produced a warning for this pull request output.
These changes need to be scrutinized before merge and only merged after a careful manual review.
- Detection reason:
parse_error - Review workflow run logs: https://github.com/askpt/code-metrics/actions/runs/31351338847
…0810-139cdc3ffa6eb440
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #526 +/- ##
==========================================
+ Coverage 81.76% 81.82% +0.06%
==========================================
Files 13 13
Lines 4386 4386
Branches 449 450 +1
==========================================
+ Hits 3586 3589 +3
+ Misses 799 796 -3
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds C# regression coverage for logical-operator complexity deduplication.
Changes:
- Tests chained
&&as one complexity increment. - Tests mixed
&&/||as separate sequences.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…0810-139cdc3ffa6eb440
askpt
deleted the
repo-assist/test-csharp-chained-logical-20260810-139cdc3ffa6eb440
branch
August 10, 2026 15:07
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.
Warning
Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.
What happened
The threat detection results could not be parsed.
Review the workflow run logs for details.
🤖 This pull request was created by Repo Assist, an automated AI assistant.
Summary
Adds unit tests for C#'s logical operator chain deduplication (
a && b && ccounts once, not per pair), mirroring the existing JS/Go/Python/Rust tests for the same behaviour. This was the one language missing this specific regression test, and the corresponding branch incsharpAnalyzer.ts'sgetComplexityIncrement(the parent-chain short-circuit that returns 0 for inner nodes of a same-operator chain) was previously uncovered.Tests added
C#: chained && counts once, not per pair—a && b && cshould have complexity 1C#: mixed && and || counts each sequence separately—a && b || cshould have complexity 2Test Status
Coverage improvement (csharpAnalyzer.ts): branches 77.46% -> 78.32%. All other files unchanged.
Note: the full
npm test(VS Code integration test) could not be run in this sandboxed environment due togetaddrinfo EAI_AGAIN update.code.visualstudio.com(no network access to download VS Code) — this is a known environment limitation, not caused by this change.Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
releaseassets.githubusercontent.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
Add this agentic workflow to your repo
To install this agentic workflow, run