Skip to content

Conversation

@SergeyTeplyakov
Copy link
Owner

Enhances RecursiveCallAnalyzer to avoid false positives when ref parameters are modified or passed to other methods before recursive calls. Adds logic to distinguish calls on different instances and updates tests to cover these scenarios.

Plus downgraded the compiler packages because they cause issues when adopting them.

Enhances RecursiveCallAnalyzer to avoid false positives when ref parameters are modified or passed to other methods before recursive calls. Adds logic to distinguish calls on different instances and updates tests to cover these scenarios.

Plus downgraded the compiler packages because they cause issues when adopting them.
@SergeyTeplyakov SergeyTeplyakov requested a review from Copilot July 30, 2025 23:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the RecursiveCallAnalyzer to reduce false positives by improving detection of legitimate recursive calls. The analyzer now distinguishes between calls on different instances and tracks when ref parameters are modified before recursive calls.

  • Added logic to detect when ref parameters are "touched" (modified or passed to other methods) before recursive calls
  • Implemented instance tracking to differentiate between calls on the same instance vs different instances
  • Downgraded Microsoft CodeAnalysis packages from 4.14.0 to 4.13.0 to resolve adoption issues

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
RecursiveCallAnalyzer.cs Enhanced with ref parameter tracking and instance differentiation logic
RecursiveCallAnalyzerTests.cs Added comprehensive test cases for new analyzer scenarios
Directory.Packages.props Downgraded Microsoft CodeAnalysis package versions
Comments suppressed due to low confidence (1)

src/ErrorProne.NET.CoreAnalyzers/RecursiveCallAnalyzer.cs:10

  • The version 0.8.0-beta.1 for ErrorProne.NET.CoreAnalyzers appears to be upgrading from 0.6.1-beta.1, which contradicts the PR description stating packages were downgraded. Please verify this version exists and is intended.
    [DiagnosticAnalyzer(LanguageNames.CSharp)]

@SergeyTeplyakov SergeyTeplyakov merged commit d3333d0 into master Jul 30, 2025
1 check passed
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