Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 90365c9

Browse files
committed
Java/Kotlin: Add a consistency query for BinaryExpr
1 parent 9e2a3a9 commit 90365c9

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import java
2+
3+
from BinaryExpr be, string reason
4+
where not exists(be.getLeftOperand()) and reason = "No left operand"
5+
or not exists(be.getRightOperand()) and reason = "No right operand"
6+
or exists(Expr e, int i | e.isNthChildOf(be, i) and i != 0 and i != 1 and reason = "Unexpected operand " + i.toString())
7+
or be.getOp() = " ?? " and reason = "No operator name"
8+
select be, reason

0 commit comments

Comments
 (0)