Method decode
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public Annotation decode(BufferItem tokener, char endTag, Annotation parent) {
if (tokener == null) {
return null;
}
char item = tokener.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 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public Annotation decode(BufferItem tokener, char endTag, Annotation parent) {
if (tokener == null) {
return null;
}
char item = tokener.getCurrentChar();
Method toString
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(this.name);
if (children == 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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public SimpleList<Annotation> getValue() {
SimpleList<Annotation> list = new SimpleList<Annotation>();
if (children != null) {
if (children instanceof Annotation) {
list.add(children);
- 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 toString
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(this.name);
if (children == null) {
Method create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static Annotation create(String value, String... values) {
Annotation annotation = new Annotation();
if (values == null || values.length < 1) {
annotation.decode(value);
} else {
- 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 this;
Method addValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected Annotation addValue(Annotation... values) {
if (values == null) {
return this;
}
SimpleList<?> list;
- 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 withKeyValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public Annotation withKeyValue(String key, String value) {
this.name = key;
this.keyValue = true;
SimpleList<Annotation> list = new SimpleList<Annotation>();
if (value != null && value.length() > 0) {
- 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"