File Buffer.java
has 462 lines of code (exceeds 250 allowed). Consider refactoring. Open
package de.uniks.networkparser.buffer;
/*
NetworkParser
The MIT License
Buffer
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
public abstract class Buffer implements BufferItem {
public static final String STOPCHARSJSON = ",:]}/\\\"[{;=# ";
public static final String STOPCHARSXML = ",]}/\\\"[{;=# ";
public static final char[] STOPCHARSXMLEND = new char[] { '"', ',', ']', '}', '/', '\\', '[', '{', ';', '=', '#',
'>', '\r', '\n', ' ' };
Method parseString
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
protected CharacterBuffer parseString(CharacterBuffer sc, boolean allowQuote, boolean nextStep, char... quotes) {
sc.with(getCurrentChar());
if (quotes == null) {
return sc;
}
- 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 skipTo
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
@Override
public boolean skipTo(String search, boolean order, boolean notEscape) {
if (position() < 0) {
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
Method nextValue
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
@Override
public Object nextValue(BaseItem creator, boolean allowQuote, boolean allowDuppleMark, char c) {
CharacterBuffer value = nextValue(c, allowDuppleMark);
if (value.length() < 1) {
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 parseString
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected CharacterBuffer parseString(CharacterBuffer sc, boolean allowQuote, boolean nextStep, char... quotes) {
sc.with(getCurrentChar());
if (quotes == null) {
return sc;
}
Method nextValue
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected CharacterBuffer nextValue(char c, boolean allowDuppleMark) {
CharacterBuffer sb = new CharacterBuffer();
if (allowDuppleMark) {
while (c >= ' ' && STOPCHARSXML.indexOf(c) < 0) {
sb.with(c);
- 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 nextValue
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Object nextValue(BaseItem creator, boolean allowQuote, boolean allowDuppleMark, char c) {
CharacterBuffer value = nextValue(c, allowDuppleMark);
if (value.length() < 1) {
return null;
Method skipTo
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public boolean skipTo(String search, boolean order, boolean notEscape) {
if (position() < 0) {
return false;
}
Method array
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public byte[] array(int len, boolean current) {
if (len == -1) {
len = remaining();
} else if (len == -2) {
len = length();
- 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 skipChar
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@Override
public char skipChar(char... quotes) {
char c = getCurrentChar();
if (quotes == null) {
return c;
- 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 skipTo
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@Override
public boolean skipTo(char search, boolean notEscape) {
int len = length();
char lastChar = 0;
if (this.position() > 0 && this.position() < len) {
- 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 skipIf
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public boolean skipIf(boolean allowSpace, char... quotes) {
char c = getCurrentChar();
if (quotes == null) {
return 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
Method nextString
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@Override
public CharacterBuffer nextString(CharacterBuffer sc, boolean allowQuote, boolean nextStep, char... quotes) {
if (getCurrentChar() == 0 || quotes == null) {
return sc;
}
- 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 getStringList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Override
public SimpleList<String> getStringList() {
SimpleList<String> list = new SimpleList<String>();
CharacterBuffer sc = new CharacterBuffer();
do {
- 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 null;
Avoid too many return
statements within this method. Open
return myLong;
Avoid too many return
statements within this method. Open
return Integer.valueOf(myLong.intValue());
Avoid too many return
statements within this method. Open
return value;
Avoid too many return
statements within this method. Open
return d;