(expr)
| 1016 | |
| 1017 | |
| 1018 | def countSideEffectsRecursive(expr): |
| 1019 | if not expr or expr.str == ';': |
| 1020 | return 0 |
| 1021 | if expr.str == '=' and expr.astOperand1 and expr.astOperand1.str == '[': |
| 1022 | prev = expr.astOperand1.previous |
| 1023 | if prev and (prev.str == '{' or prev.str == '{'): |
| 1024 | return countSideEffectsRecursive(expr.astOperand2) |
| 1025 | if expr.str == '=' and expr.astOperand1 and expr.astOperand1.str == '.': |
| 1026 | e = expr.astOperand1 |
| 1027 | while e and e.str == '.' and e.astOperand2: |
| 1028 | e = e.astOperand1 |
| 1029 | if e and e.str == '.': |
| 1030 | return 0 |
| 1031 | if expr.isAssignmentOp or expr.str in {'++', '--'}: |
| 1032 | return 1 |
| 1033 | # Todo: Check function calls |
| 1034 | return countSideEffectsRecursive(expr.astOperand1) + countSideEffectsRecursive(expr.astOperand2) |
| 1035 | |
| 1036 | |
| 1037 | def isBoolExpression(expr): |
no outgoing calls
no test coverage detected