-
Notifications
You must be signed in to change notification settings - Fork 25
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
Modifier reused - use code flow analysis #454
base: main
Are you sure you want to change the base?
Modifier reused - use code flow analysis #454
Conversation
Thanks for the contribution! Unfortunately we can't verify the commit author(s): Alexander Sitnikov <a***@y***.ru>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, sign the Salesforce Inc. Contributor License Agreement and this Pull Request will be revalidated. |
0fcf35d
to
50fd716
Compare
Thanks for the contribution! Before we can merge this, we need @aasitnikov to sign the Salesforce Inc. Contributor License Agreement. |
is KtReferenceExpression -> { | ||
modifierNames.contains(expression.text) | ||
// Convert UAST into simplified AST, that will be used in code flow analysis | ||
private fun UMethod.toSimplifiedCfaAst(references: Set<PsiElement>): CfaBlock { |
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.
Can we pull this custom AST code out to its own file or package? And ideally with a lot more docs? This looks like it's adding quite a bit of complexity to the check on the face of it
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.
Sure
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.
Didn't extract custom AST into other file, but added a lot more docs and fixed a couple of bugs from previous version
50fd716
to
f859b76
Compare
Improves ModifierReusedDetector
Row(modifier = Modifier.then(modifier))
CFA treats blocks and lambdas like simple blocks of code, and also tracks the control flow of return statements and if/when statements. If control flow graph contains path that has two or more such calls, they will be reported.