Synopsis: | Too many fields |
Language: | Java |
Severity Level: | 3 |
Category: | CodeSize |
Description: |
Classes that have too many fields could be redesigned to have fewer fields, possibly
through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field. This rule is triggered in case a class has 15 or more fields.
public class Person { String one; int two; int three; [... many more public fields ...] } |