Package: groovy.org.codenarc.rule.unnecessary

## [Groovy] Class UnnecessaryBooleanExpressionRule

- groovy.org.codenarc.rule.unnecessary.UnnecessaryBooleanExpressionRule

- Rule that checks unnecessary boolean expressions, including ANDing (&&) or ORing (||) with `true`, `false`, `null`, or a Map/List/String/Number literal. This rule also checks for negation (!) of `true`, `false`, `null`, or a Map/List/String/Number literal. Examples include:

  - `def result = value && true`
  - `if (false || value) { .. }`
  - `return value && Boolean.FALSE`
  - `result = value && "abc"`
  - `result = null && value`
  - `result = value && 123`
  - `result = 678.123 || true`
  - `result = value && [x, y]`
  - `def result = [a:123] && value`
  - `result = !true`
  - `result = !false`
  - `result = !Boolean.TRUE`
  - `result = !null`
  - `result = !"abc"`
  - `result = ![a:123]`
  - `result = ![a,b]`
  Authors:
    Chris Mair

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `Class` | `astVisitorClass`
    `String` | `name`
    `int` | `priority`

- - ### Property Detail

    - #### Class astVisitorClass

    - #### String name

    - #### int priority