File AES.java
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
package de.uniks.networkparser.bytes;
import de.uniks.networkparser.buffer.BufferedBuffer;
import de.uniks.networkparser.buffer.ByteBuffer;
import de.uniks.networkparser.buffer.CharacterBuffer;
Method withKey
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public AES withKey(byte[] key) {
/* assorted internal constants */
if (key == null) {
return this;
}
- 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 withKey
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public AES withKey(byte[] key) {
/* assorted internal constants */
if (key == null) {
return this;
}
Method encodeBlock
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public byte[] encodeBlock(byte[] plain) {
/* check for bad arguments */
if (plain == null || plain.length != BLOCK_SIZE) {
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 decodeBlock
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public byte[] decodeBlock(byte[] cipher) {
/* check for bad arguments */
if (cipher == null || cipher.length != BLOCK_SIZE)
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 encodeBlock
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public byte[] encodeBlock(byte[] plain) {
/* check for bad arguments */
if (plain == null || plain.length != BLOCK_SIZE) {
return null;
}
Method decodeBlock
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public byte[] decodeBlock(byte[] cipher) {
/* check for bad arguments */
if (cipher == null || cipher.length != BLOCK_SIZE)
return null;
Method encode
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public CharacterBuffer encode(BufferedBuffer plain) {
CharacterBuffer result = new CharacterBuffer();
if (plain != null) {
result.withBufferLength(plain.length());
byte[] partByte;
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
public CharacterBuffer decode(CharSequence data) {
CharacterBuffer string = new CharacterBuffer().with(data);
int rest = ((int) string.length() / 32) * 32;
if (rest < string.length()) {
rest = 32 - data.length() + rest;
- 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 encode
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public CharacterBuffer encode(String data) {
CharacterBuffer string = new CharacterBuffer().with(data);
int rest = ((int) string.length() / 32) * 32;
if (rest < string.length()) {
rest = 32 - data.length() + rest;
- 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"