src/test/java/de/uniks/networkparser/test/model/util/StudentCreator.java
Method getValue
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
@Override
public Object getValue(Object entity, String attrName) {
if (attrName == null || entity instanceof Student == 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
Method getValue
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public Object getValue(Object entity, String attrName) {
if (attrName == null || entity instanceof Student == false) {
return null;
}
Method setValue
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public boolean setValue(Object entity, String attribute, Object value, String typ) {
if (attribute == null || entity instanceof Student == false) {
return false;
}
Method setValue
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
@Override
public boolean setValue(Object entity, String attribute, Object value, String typ) {
if (attribute == null || entity instanceof Student == false) {
return 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
Avoid too many return
statements within this method. Open
Open
return true;
Avoid too many return
statements within this method. Open
Open
return student.getIn().get(attrName.substring(pos + 1));
Avoid too many return
statements within this method. Open
Open
return student.getItem();
Avoid too many return
statements within this method. Open
Open
return student.getUniversity();
Avoid too many return
statements within this method. Open
Open
return student.getCredits();
Avoid too many return
statements within this method. Open
Open
return true;
Avoid too many return
statements within this method. Open
Open
return true;
Avoid too many return
statements within this method. Open
Open
return student.getDynamicValues();
Avoid too many return
statements within this method. Open
Open
return student.getIn();
Avoid too many return
statements within this method. Open
Open
return student.getFirstName();
Avoid too many return
statements within this method. Open
Open
return true;
Avoid too many return
statements within this method. Open
Open
return true;
Avoid too many return
statements within this method. Open
Open
return true;
Avoid too many return
statements within this method. Open
Open
return true;
Avoid too many return
statements within this method. Open
Open
return student.getLastName();
Avoid too many return
statements within this method. Open
Open
return student.getDynamicValue(attrName);