TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - Java Coding Standard
Search

Rule:  Design35Checked automatically with code checker

Synopsis:Consider simply returning values instead of storing it in a local variable
Language:Java
Severity Level:3
Category:Design


Description:
Avoid unnecessarily creating local variables
public class Foo {
    public int foo() {
      int x = doSomething();
      return x;  // instead, just 'return doSomething();'
    }
  }