fix: DependsOnConflictAnalyzer reports all dependency cycles (#4862)#4913
Merged
fix: DependsOnConflictAnalyzer reports all dependency cycles (#4862)#4913
Conversation
Replace the Chain-based traversal with a proper DFS using a visited set and backtracking path. The old approach returned immediately upon finding any already-traversed method, which prevented exploring other branches and caused methods involved in cycles to go unreported.
Contributor
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. The DFS-based cycle detection is a clean and correct replacement for the previous
|
This was referenced Feb 22, 2026
Open
This was referenced Feb 23, 2026
Open
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.
Summary
Chain-based dependency traversal inDependsOnConflictAnalyzerwith a proper DFS using avisitedset and backtrackingpathlistGetDependenciesmethod returned immediately upon finding any already-traversed method, which prevented exploring other branches of the dependency graph and caused methods involved in cycles to go unreportedTUnit0033diagnostic, including those previously missed in class-level[DependsOn]scenarios with multiple test methodsCloses #4862
Test plan
DependsOnConflictAnalyzerTestspass (verified on net9.0)Direct_Conflict_Other_Class_Raises_ErrorandDirect_Conflict_Other_Class_Raises_Error_GenericAttributetests to expect diagnostics on all 4 test method locations (previously only 2 of 4 were reported)