Method parseObjectTableAttrs
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
private void parseObjectTableAttrs(CharacterBuffer currentToken, Buffer buffer) {
/* skip column names */
if (currentToken == null || map == null) {
return;
}
- 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 parseLine
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
protected int parseLine(int deep, EntityList owner, Buffer buffer) {
if (buffer == null) {
return 0;
}
char c = buffer.getCurrentChar();
- 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 a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public Object decode(String yaml) {
CharacterBuffer buffer = new CharacterBuffer().with(yaml);
Object root = null;
refs = new SimpleKeyValueList<Object, SimpleKeyValueList<String, SimpleList<String>>>();
while (buffer.isEnd() == false) {
- 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 parseLine
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected int parseLine(int deep, EntityList owner, Buffer buffer) {
if (buffer == null) {
return 0;
}
char c = buffer.getCurrentChar();
Method parseObjectTableAttrs
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void parseObjectTableAttrs(CharacterBuffer currentToken, Buffer buffer) {
/* skip column names */
if (currentToken == null || map == null) {
return;
}
Method setValue
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private boolean setValue(SendableEntityCreator creator, Object obj, String attrName, String attrValue) {
if (map == null) {
return false;
}
Object targetObj = map.getObject(attrValue);
- 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 setValue
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
private boolean setValue(SendableEntityCreator creator, Object obj, String attrName, String attrValue) {
if (map == null) {
return false;
}
Object targetObj = map.getObject(attrValue);
Method decode
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Object decode(String yaml) {
CharacterBuffer buffer = new CharacterBuffer().with(yaml);
Object root = null;
refs = new SimpleKeyValueList<Object, SimpleKeyValueList<String, SimpleList<String>>>();
while (buffer.isEnd() == false) {
Method parseUsualObjectAttrs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private Object parseUsualObjectAttrs(CharacterBuffer currentToken, Buffer buffer) {
if (buffer == null || currentToken == null || map == null) {
return null;
}
String objectId = currentToken.trimEnd(1).toString();
- 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 deeply nested control flow statements. Open
if (currentToken.endsWith("]", true)) {
value = currentToken.substring(0, currentToken.length() - 1);
}
Avoid deeply nested control flow statements. Open
if (value != null) {
creator.setValue(entity, attribute, value, SendableEntityCreator.NEW);
}
Avoid deeply nested control flow statements. Open
if (value.trim().equals("") == false ) {
setValue(creator, obj, attrName, value);
}