Skip to content

Files

Latest commit

 

History

History
29 lines (16 loc) · 626 Bytes

AvoidInlineConditionals.md

File metadata and controls

29 lines (16 loc) · 626 Bytes

Pattern: Use of inline conditional

Issue: -

Description

Detects inline conditionals. Here is one example of an inline conditional:

String a = getParameter("a");
String b = (a==null || a.length<1) ? null : a.substring(1);

Rationale: Some developers find inline conditionals hard to read, so their employer's coding standards forbid them.

Examples

To configure the check:

<module name="AvoidInlineConditionals"/>

Further Reading