Reports unnecessary local variables that add nothing to the comprehensibility of a method, including:

Example:


  boolean yes() {
    boolean b = true;
    return b;
  }

After the quick-fix is applied:


  boolean yes() {
    return true;
  }
  

Configure the inspection: