Reports methods and method hierarchies that always return the same constant.

The inspection works differently in batch-mode (from Code | Inspect Code or Code | Analyze Code | Run Inspection by Name) and on-the-fly in the editor:

Example:


  class X {
                // Warn only in batch-mode:
    int xxx() { // Method 'xxx()' and all its overriding methods always return '0'
      return 0;
    }
  }

  class Y extends X {
    @Override
    int xxx() {
        return 0;
    }

                // Warn only in batch-mode:
    int yyy() { // Method 'yyy()' always returns '0'
        return 0;
    }

                                  // Warn both in batch-mode and on-the-fly:
    final int zzz(boolean flag) { // Method 'zzz()' always returns '0'
        if (Math.random() > 0.5) {
            return 0;
        }
        return 0;
    }
  }