-
Notifications
You must be signed in to change notification settings - Fork 226
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
Add C# 9 test cases (8 rules) #3698
Conversation
55a795b
to
34afce2
Compare
6ebf970
to
7c25305
Compare
043c99d
to
542fc36
Compare
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.
LGTM, I've left 2 comments
@@ -0,0 +1,73 @@ | |||
using System; | |||
|
|||
int a = 0; // Compliant - FN |
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 is a local variable in the main
method - why is this an FN?
same for line 8
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.
My bad. It's not.
new R().MyMethod(); | ||
i = new R().MyMethod2(); | ||
|
||
int NeverUsed(int neverUsedVal) // FN - the returned value is not used |
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.
does this work for local functions in C# 7?
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.
Yes, we have a few test cases with local functions and static local functions and the analysis works as expected. It seems we have issues only with local functions defined as top level statements.
Kudos, SonarCloud Quality Gate passed! 0 Bugs |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Related to #3668