-
-
Notifications
You must be signed in to change notification settings - Fork 767
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
Improve UnusedPrivateMember when it's related with parameters #1949
Conversation
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.
Excuse me for reporting back after such a long timeframe.
I suppose that the problem here lies in the following referenced lines.
Note that I didn't debug the test code.
Only a single parameter named unusedParameter
gets added to the Map
.
Therefore, only 1 parameter gets reported.
I hope that this serves as a good starting point for you. If not, please don't hesitate to ask for help.
387f95e
to
32d0701
Compare
Reading the code I found that the functions has the same problem but it's far more complicated to check. I'm going to create an issue to talk about that. So this PR is only to check the parameters. |
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.
I assume that this is then ready to merge. Am I right?
val code = """ | ||
class Test { | ||
val value = usedMethod(1) | ||
val value2 = usedMethod2(1) | ||
|
||
private fun usedMethod(unusedParameter: Int): Int { | ||
return 5 | ||
} | ||
|
||
private fun usedMethod2(unusedParameter: Int) { | ||
return 5 | ||
} | ||
} | ||
""" |
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.
nit: 4 missing spaces (indentation)
Please elaborate on that in a separate issue, so that the community can also understand this problem. |
If two parameters are called the same in different calls now it's detected as two warnings.
32d0701
to
febc839
Compare
Fixed. Yes, this is ready to merge and I'll write the issue. |
If two parameters are called the same in different calls now it's detected as two warnings.
If two parameters are called the same in different calls now it's detected as two warnings.
If two parameters are called the same in two different functions and both are not used now we report them as two errors.