File RabbitMessage.java
has 766 lines of code (exceeds 250 allowed). Consider refactoring. Open
package de.uniks.networkparser.ext.io;
/*
The MIT License
Method analysePayLoad
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
public boolean analysePayLoad(NodeProxyBroker broker) {
if (payload == null || broker == null) {
return false;
}
classId = payload.getShort();
- 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
RabbitMessage
has 41 methods (exceeds 20 allowed). Consider refactoring. Open
public class RabbitMessage {
public static final byte NULL = 0;
public static final byte FRAME_METHOD = 1;
public static final byte FRAME_HEADER = 2;
Method writeValue
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
public boolean writeValue(Object value) {
if (accumulator == null) {
return false;
}
if (value == 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 writeFieldValue
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public boolean writeFieldValue(Object value) {
if (accumulator == null) {
return false;
}
if (value == 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 writeFieldValue
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean writeFieldValue(Object value) {
if (accumulator == null) {
return false;
}
if (value == null) {
Method writeValue
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean writeValue(Object value) {
if (accumulator == null) {
return false;
}
if (value == null) {
Method readFieldValue
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private static Object readFieldValue(ByteBuffer in) {
if (in == null) {
return null;
}
byte type = in.getByte();
- 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 readFieldValue
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static Object readFieldValue(ByteBuffer in) {
if (in == null) {
return null;
}
byte type = in.getByte();
Method initValues
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void initValues(NodeProxyBroker broker) {
if (broker == null) {
return;
}
Object[][] data = new Object[][] {
Method analysePayLoad
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean analysePayLoad(NodeProxyBroker broker) {
if (payload == null || broker == null) {
return false;
}
classId = payload.getShort();
Method write
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public boolean write(OutputStream stream, NetworkParserLog logger) {
if (stream == null) {
return false;
}
try {
- 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 withValues
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public RabbitMessage withValues(Object... args) {
if (accumulator == null) {
accumulator = new ByteBuffer();
if (getType() != 3) {
accumulator.insert(new byte[4], 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 readFrom
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static RabbitMessage readFrom(DataInputStream is, NetworkParserLog logger) {
if (is == null) {
return null;
}
byte frameEndMarker = 0;
Method write
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean write(OutputStream stream, NetworkParserLog logger) {
if (stream == null) {
return false;
}
try {
Method createConsume
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public static RabbitMessage createConsume(short channel, String queue, String consumerTag, boolean noLocal,
boolean noAck, boolean exclusive, boolean nowait, Map<String, Object> table) {
Consider simplifying this complex logical expression. Open
if (value instanceof Integer || value instanceof Byte || value instanceof Double || value instanceof Float
|| value instanceof Long || value instanceof Short || value instanceof Boolean) {
accumulator.insert(value, true);
return true;
}
Method initValues
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private void initValues(NodeProxyBroker broker) {
if (broker == null) {
return;
}
Object[][] data = new Object[][] {
- 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 createQueue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static RabbitMessage createQueue(short channel, String queue, boolean durable, boolean exclusive,
boolean autoDelete, Map<String, Object> table) {
Method writeMap
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public RabbitMessage writeMap(Map<?, ?> map) {
if (accumulator == null) {
return null;
}
if (map == 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
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return readTable(in);
Avoid too many return
statements within this method. Open
return in.getDouble();
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return readArray(in);
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return new Date(in.getInt() * 1000);
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return in.getBoolean();
Avoid too many return
statements within this method. Open
return readBytes(in);
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return in.getInt();
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return in.getShort();
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return in.getFloat();
Avoid too many return
statements within this method. Open
return new BigDecimal(new BigInteger(unscaled), scale);
Avoid too many return
statements within this method. Open
return in.getByte();
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return true;
Method readFrom
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static RabbitMessage readFrom(DataInputStream is, NetworkParserLog logger) {
if (is == null) {
return null;
}
byte frameEndMarker = 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"