The use of a string literal in a boolean test is likely an error since the test will always evaluate to true (i.e. the string is a non-0 value).


== Noncompliant Code Example

----
if ("foo") { // Noncompliant - always evaluates to true
  ...
} else {
  // unreachable, never executed
}
----


== See

* http://cwe.mitre.org/data/definitions/571[MITRE, CWE-571] - Expression is Always True

