Method decodingModel
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
private static Object decodingModel(Buffer buffer, IdMap map, Tokener tokener, char endTag) {
if (buffer == null) {
return null;
}
String className = 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
Method decodingModel
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static Object decodingModel(Buffer buffer, IdMap map, Tokener tokener, char endTag) {
if (buffer == null) {
return null;
}
String className = null;
Method decode
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public <T> T decode(Object json, Class<T> classOfT) {
JsonObject jsonObject = null;
if (json instanceof String) {
jsonObject = new JsonObject().withValue((String) json);
} else if (json instanceof JsonObject) {
- 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 decode
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public <T> T decode(Object json, Class<T> classOfT) {
JsonObject jsonObject = null;
if (json instanceof String) {
jsonObject = new JsonObject().withValue((String) json);
} else if (json instanceof JsonObject) {
Avoid deeply nested control flow statements. Open
if (key.length() < 1) {
break;
}
Avoid deeply nested control flow statements. Open
if (buffer.getCurrentChar() == propStartTag) {
/* new Subtype */
Object subElement = decodingModel(buffer, map, tokener, propEndTag);
creator.setValue(result, key, subElement, SendableEntityCreator.NEW);
} else if (buffer.getCurrentChar() == JsonArray.START) {
Method decodeModel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static <T> T decodeModel(Buffer buffer, IdMap map) {
if (buffer == null || map == null) {
return null;
}
char firstChar = buffer.nextClean(true);
- 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 classOfT.cast(result);
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return result;