-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix S3900 FN: Conversion operations #7002
Changes from 1 commit
a5e2f38
8b9526f
623b3c3
ce031c0
46c25ea
f8d6f10
92536e2
73030fd
a850e07
d738fa2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,13 +93,14 @@ bool NullableStateIsNotKnownForParameter(IParameterSymbol symbol) => | |
|
||
private static bool IsParameterDereferenced(IOperationWrapperSonar operation) => | ||
operation.Parent != null | ||
&& operation.Parent.IsAnyKind( | ||
&& (operation.Parent.IsAnyKind( | ||
OperationKindEx.Invocation, | ||
OperationKindEx.FieldReference, | ||
OperationKindEx.PropertyReference, | ||
OperationKindEx.EventReference, | ||
OperationKindEx.Await, | ||
OperationKindEx.ArrayElementReference); | ||
OperationKindEx.ArrayElementReference) | ||
|| (operation.Parent.Kind == OperationKindEx.Conversion && IsParameterDereferenced(operation.Parent.ToSonar()))); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The formatting makes this hard to understand. Try indenting the last line. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
||
private sealed class ArgumentDereferenceWalker : SafeCSharpSyntaxWalker | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition is getting a bit difficult to read.
Maybe it would make sense to build an array of
OperationKindEx
, to be used inIsAnyKind
?