hackedteam/core-blackberry

View on GitHub
RCSBlackBerry/src/blackberry/crypto/Encryption.java

Summary

Maintainability
C
1 day
Test Coverage

Encryption has 22 methods (exceeds 20 allowed). Consider refactoring.
Open

public class Encryption {

    //#ifdef DEBUG
    private static Debug debug = new Debug("Encryption", DebugLevel.VERBOSE);

Severity: Minor
Found in RCSBlackBerry/src/blackberry/crypto/Encryption.java - About 2 hrs to fix

    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
    Severity: Minor
    Found in RCSBlackBerry/src/blackberry/crypto/Encryption.java - About 2 hrs to fix

      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;
      Severity: Minor
      Found in RCSBlackBerry/src/blackberry/crypto/Encryption.java - About 1 hr to fix

      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
      Severity: Minor
      Found in RCSBlackBerry/src/blackberry/crypto/Encryption.java - About 1 hr to fix

        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;
        Severity: Minor
        Found in RCSBlackBerry/src/blackberry/crypto/Encryption.java - About 1 hr to fix

          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
          
          
          Severity: Minor
          Found in RCSBlackBerry/src/blackberry/crypto/Encryption.java - About 1 hr to fix

            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) {
            Severity: Minor
            Found in RCSBlackBerry/src/blackberry/crypto/Encryption.java - About 35 mins to fix

            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
            Severity: Minor
            Found in RCSBlackBerry/src/blackberry/crypto/Encryption.java - About 35 mins to fix

            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

            There are no issues that match your filters.

            Category
            Status