Files
codeql/go/ql/test/query-tests/RedundantCode/CompareIdenticalValues/CompareIdenticalValues.go
2026-06-11 07:15:54 +02:00

13 lines
212 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 && // $ Alert // NOT OK
x <= r.x+r.width &&
y <= r.y+r.height
}