Encryption
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
public class Encryption {
//#ifdef DEBUG
private static Debug debug = new Debug("Encryption", DebugLevel.VERBOSE);
File Encryption.java
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
//#preprocess
/* *************************************************
* Copyright (c) 2010 - 2010
* HT srl, All rights reserved.
* Project : RCS, RCSBlackBerry_lib
Method scramble
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private static String scramble(final String name, int seed,
final boolean enc) {
final char[] retString = name.toCharArray();
final int len = name.length();
int i, j;
- 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 decryptData
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public byte[] decryptData(final byte[] cyphered, final int plainlen,
final int offset) throws CryptoException {
final int enclen = cyphered.length - offset;
if (enclen % 16 != 0) {
//#ifdef DEBUG
Method scramble
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static String scramble(final String name, int seed,
final boolean enc) {
final char[] retString = name.toCharArray();
final int len = name.length();
int i, j;
Method encryptData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean encryptData(DataInputStream is, DataOutputStream os) {
//#ifdef DBC
Check.requires(keyReady, "Key not ready");
//#endif
Method pad
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected byte[] pad(byte[] plain, int offset, int len, boolean PKCS5) {
final int clen = getNextMultiple(len);
if (clen > 0) {
final byte[] padplain = new byte[clen];
if (PKCS5) {
- 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 decryptData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public byte[] decryptData(final byte[] cyphered, final int plainlen,
final int offset) throws CryptoException {
final int enclen = cyphered.length - offset;
if (enclen % 16 != 0) {
//#ifdef DEBUG
- 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"