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.
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.
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.