|
33 | 33 | import org.sonar.plugins.python.api.tree.IfStatement; |
34 | 34 | import org.sonar.plugins.python.api.tree.Statement; |
35 | 35 | import org.sonar.plugins.python.api.tree.Tree; |
36 | | -import static org.sonar.plugins.python.api.tree.Tree.Kind.FUNCDEF; |
| 36 | +import static org.sonar.plugins.python.api.tree.Tree.Kind.*; |
37 | 37 |
|
38 | 38 | /** |
39 | 39 | * FUNCTIONAL DESCRIPTION : please see ASCIIDOC description file of this rule (inside `ecocode-rules-spcifications`) |
@@ -95,7 +95,7 @@ private void visitNodeContent(SubscriptionContext context, List<Statement> pLstS |
95 | 95 | // // the cirrent node is a block : visit block content |
96 | 96 | // visitNodeContent(((BlockTree)statement).statements(), pLevel); |
97 | 97 | // } else |
98 | | - if (statement.is(Tree.Kind.IF_STMT)) { |
| 98 | + if (statement.is(IF_STMT)) { |
99 | 99 | visitIfNode(context, (IfStatement)statement, pLevel); |
100 | 100 | } |
101 | 101 | } |
@@ -158,14 +158,14 @@ private void computeIfVariables(SubscriptionContext context, IfStatement pIfTree |
158 | 158 | private void computeConditionVariables(SubscriptionContext context, BinaryExpression pBinExprTree, int pLevel) { |
159 | 159 |
|
160 | 160 | // if multiple conditions, continue with each part of complex expression |
161 | | - if (pBinExprTree.is(Tree.Kind.AND) || pBinExprTree.is(Tree.Kind.OR)) { |
| 161 | + if (pBinExprTree.is(AND) || pBinExprTree.is(OR)) { |
162 | 162 | if (pBinExprTree.leftOperand() instanceof BinaryExpression) { |
163 | 163 | computeConditionVariables(context, (BinaryExpression) pBinExprTree.leftOperand(), pLevel); |
164 | 164 | } |
165 | 165 | if (pBinExprTree.rightOperand() instanceof BinaryExpression) { |
166 | 166 | computeConditionVariables(context, (BinaryExpression) pBinExprTree.rightOperand(), pLevel); |
167 | 167 | } |
168 | | - } else if (pBinExprTree.is(Tree.Kind.COMPARISON)) { |
| 168 | + } else if (pBinExprTree.is(COMPARISON)) { |
169 | 169 | // else if (pBinExprTree.is(Tree.Kind.EQUAL_TO) |
170 | 170 | // || pBinExprTree.is(Tree.Kind.NOT_EQUAL_TO) |
171 | 171 | // || pBinExprTree.is(Tree.Kind.GREATER_THAN) |
|
0 commit comments