Skip to content

Files

Latest commit

 

History

History
46 lines (33 loc) · 908 Bytes

OneStatementPerLine.md

File metadata and controls

46 lines (33 loc) · 908 Bytes

Pattern: Multiple statements in one line

Issue: -

Description

Prefer using one statement per line to improve code readability.

The following statement types are checked:

  • variable declaration
  • empty
  • assignment
  • expression
  • increment
  • object creation
  • import
  • for loop
  • break
  • continue
  • return

Default configuration

<module name="OneStatementPerLine"/>

Examples

Example of incorrect code:

import java.io.EOFException; import java.io.BufferedReader;

Example of correct code:

import java.io.EOFException;
import java.io.BufferedReader;

Further Reading