fixes #682: rewrite no-constant-condition rule

Fixes #682. 100% test coverage.