Files
codeql/go/ql/test/query-tests/RedundantCode/CompareIdenticalValues/CompareIdenticalValues.go
2022-05-20 10:07:19 -07:00

13 lines
201 B
Go

package main
type Rectangle struct {
x, y, width, height int
}
func (r *Rectangle) containsBad(x, y int) bool {
return r.x <= x &&
y <= y && // NOT OK
x <= r.x+r.width &&
y <= r.y+r.height
}