Repository navigation
Conversation
CouplingBetweenObjects normalized scalar built-in type names but left the trailing array rank attached, so int[] failed the built-in comparison and added a false dependency. Twelve user-defined field types plus one primitive array reported coupling 13; the scalar int was correctly excluded, so the array suffix alone changed the result. BaseTypeName now strips trailing array rank and pointer syntax (int[], int[,], int[][], int*) before the built-in comparison, then the nullable suffix (int?[], int*[]?). Existing leading-syntax trimming, generic stripping, and qualified-name handling are unchanged. Arrays of user-defined types still count one dependency for their element type, in every path the rule reads a type (fields, parameters, return types, object creations). Regression tests cover primitive arrays across field, parameter, and return positions, and assert that an array of a user-defined type counts exactly once via its element type. Fixes #87 Co-Authored-By: Claude Code <noreply@anthropic.com>
This branch has not been deployed
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
CouplingBetweenObjects normalized scalar built-in type names but left the trailing array rank attached, so
int[]failed the built-in comparison and added a false dependency. Twelve user-defined field types plus one primitive array reported coupling 13 and triggered the rule; removingint[]alone dropped it below the threshold (#87).BaseTypeNamenow strips trailing array rank and pointer syntax (int[],int[,],int[][],int*) before the built-in comparison, then the nullable suffix (int?[],int*[]?). Existing leading-syntax trimming, generic stripping, and qualified-name handling are unchanged. Arrays of user-defined types still count one dependency for their element type, in every path the rule reads a type (fields, parameters, return types, object creations).Testing
CouplingBetweenObjects_PrimitiveArrayNotCounted,CouplingBetweenObjects_PrimitiveArrayParameterNotCounted) — both watched red before the fix.CouplingBetweenObjects_UserDefinedArrayStillCountedasserts an array of a user-defined type counts exactly once via its element type (coupling 12, not 13 or 11).int[]now exits 0; the same fixture withM[]still reports coupling 13 and exits 2.dotnet format --verify-no-changes, Release build with warnings-as-errors, and self-analysis (csharp,codesize,design) all clean.Fixes #87
🤖 Generated with Claude Code