Method parseJsonObject
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private boolean parseJsonObject(Entity item, String parent, boolean ignoreCase) {
if (item == null) {
return false;
}
for (int i = 0; i < item.size(); i++) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getText
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
@Override
public String getText(CharSequence label, Object model, Object gui) {
if (label == null) {
return null;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
TextItems
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
public class TextItems extends SimpleKeyValueList<String, Object>
implements SendableEntityCreator, LocalisationInterface {
public static final String PROPERTY_VALUE = "value";
private LocalisationInterface customLanguage = null;
private ObjectCondition listener = null;
Method parseJsonObject
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
private boolean parseJsonObject(Entity item, String parent, boolean ignoreCase) {
if (item == null) {
return false;
}
for (int i = 0; i < item.size(); i++) {
Method getText
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public String getText(CharSequence label, Object model, Object gui) {
if (label == null) {
return null;
}
Method get
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
@Override
public String get(Object key) {
if (key == null || key instanceof String == false) {
return null;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this method. Open
return label.toString();
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return text;