(cond)
| 960 | |
| 961 | |
| 962 | def findCounterTokens(cond): |
| 963 | if not cond: |
| 964 | return [] |
| 965 | if cond.str in ['&&', '||']: |
| 966 | c = findCounterTokens(cond.astOperand1) |
| 967 | c.extend(findCounterTokens(cond.astOperand2)) |
| 968 | return c |
| 969 | ret = [] |
| 970 | if ((cond.isArithmeticalOp and cond.astOperand1 and cond.astOperand2) or |
| 971 | (cond.isComparisonOp and cond.astOperand1 and cond.astOperand2)): |
| 972 | if cond.astOperand1.isName: |
| 973 | ret.append(cond.astOperand1) |
| 974 | if cond.astOperand2.isName: |
| 975 | ret.append(cond.astOperand2) |
| 976 | if cond.astOperand1.isOp: |
| 977 | ret.extend(findCounterTokens(cond.astOperand1)) |
| 978 | if cond.astOperand2.isOp: |
| 979 | ret.extend(findCounterTokens(cond.astOperand2)) |
| 980 | return ret |
| 981 | |
| 982 | |
| 983 | def isFloatCounterInWhileLoop(whileToken): |
no outgoing calls
no test coverage detected