hackedteam/core-blackberry

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

Summary

Maintainability
F
1 wk
Test Coverage

File Rijndael.java has 281 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/Rijndael.java - About 2 hrs to fix

    Method encrypt has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public void encrypt(final byte[] pt, final byte[] ct) {
            /*
             * map byte array block to cipher state and add initial round key:
             */
            int k = 0, v;
    Severity: Minor
    Found in RCSBlackBerry/src/blackberry/crypto/Rijndael.java - About 1 hr to fix

      Method decrypt has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public void decrypt(final byte[] ct, final byte[] pt) {
              /*
               * map byte array block to cipher state and add initial round key:
               */
              int k = 0, v;
      Severity: Minor
      Found in RCSBlackBerry/src/blackberry/crypto/Rijndael.java - About 1 hr to fix

        Method invertKey has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private void invertKey() {
                int d = 0, e = 4 * Nr, w;
                /*
                 * apply the inverse MixColumn transform to all round keys but the first
                 * and the last:
        Severity: Minor
        Found in RCSBlackBerry/src/blackberry/crypto/Rijndael.java - About 1 hr to fix

          Method expandKey has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              private void expandKey(final byte[] cipherKey) {
                  int temp, r = 0;
          
                  for (int i = 0, k = 0; i < Nk; i++, k += 4) {
                      rek[i] = ((cipherKey[k]) << 24) | ((cipherKey[k + 1] & 0xff) << 16)
          Severity: Minor
          Found in RCSBlackBerry/src/blackberry/crypto/Rijndael.java - About 25 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 finalize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              protected void finalize() {
                  if (rek != null) {
                      for (int i = 0; i < rek.length; i++) {
                          rek[i] = 0;
                      }
          Severity: Minor
          Found in RCSBlackBerry/src/blackberry/crypto/Rijndael.java - About 25 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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              public void decrypt(final byte[] ct, final byte[] pt) {
                  /*
                   * map byte array block to cipher state and add initial round key:
                   */
                  int k = 0, v;
          Severity: Major
          Found in RCSBlackBerry/src/blackberry/crypto/Rijndael.java and 1 other location - About 2 days to fix
          RCSBlackBerry/src/blackberry/crypto/Rijndael.java on lines 327..388

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 1363.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

              public void encrypt(final byte[] pt, final byte[] ct) {
                  /*
                   * map byte array block to cipher state and add initial round key:
                   */
                  int k = 0, v;
          Severity: Major
          Found in RCSBlackBerry/src/blackberry/crypto/Rijndael.java and 1 other location - About 2 days to fix
          RCSBlackBerry/src/blackberry/crypto/Rijndael.java on lines 204..265

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 1363.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                      rdk[d + 3] = TD0[SE[(w >>> 24)] & 0xff]
                              ^ TD1[SE[(w >>> 16) & 0xff] & 0xff]
                              ^ TD2[SE[(w >>> 8) & 0xff] & 0xff]
                              ^ TD3[SE[(w) & 0xff] & 0xff];
          Severity: Major
          Found in RCSBlackBerry/src/blackberry/crypto/Rijndael.java and 2 other locations - About 1 hr to fix
          RCSBlackBerry/src/blackberry/crypto/Rijndael.java on lines 472..475
          RCSBlackBerry/src/blackberry/crypto/Rijndael.java on lines 477..480

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 108.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                      rdk[d + 2] = TD0[SE[(w >>> 24)] & 0xff]
                              ^ TD1[SE[(w >>> 16) & 0xff] & 0xff]
                              ^ TD2[SE[(w >>> 8) & 0xff] & 0xff]
                              ^ TD3[SE[(w) & 0xff] & 0xff];
          Severity: Major
          Found in RCSBlackBerry/src/blackberry/crypto/Rijndael.java and 2 other locations - About 1 hr to fix
          RCSBlackBerry/src/blackberry/crypto/Rijndael.java on lines 472..475
          RCSBlackBerry/src/blackberry/crypto/Rijndael.java on lines 482..485

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 108.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 3 locations. Consider refactoring.
          Open

                      rdk[d + 1] = TD0[SE[(w >>> 24)] & 0xff]
                              ^ TD1[SE[(w >>> 16) & 0xff] & 0xff]
                              ^ TD2[SE[(w >>> 8) & 0xff] & 0xff]
                              ^ TD3[SE[(w) & 0xff] & 0xff];
          Severity: Major
          Found in RCSBlackBerry/src/blackberry/crypto/Rijndael.java and 2 other locations - About 1 hr to fix
          RCSBlackBerry/src/blackberry/crypto/Rijndael.java on lines 477..480
          RCSBlackBerry/src/blackberry/crypto/Rijndael.java on lines 482..485

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 108.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  if (rek != null) {
                      for (int i = 0; i < rek.length; i++) {
                          rek[i] = 0;
                      }
          
          
          Severity: Minor
          Found in RCSBlackBerry/src/blackberry/crypto/Rijndael.java and 1 other location - About 40 mins to fix
          RCSBlackBerry/src/blackberry/crypto/Rijndael.java on lines 440..446

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 52.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  if (rdk != null) {
                      for (int i = 0; i < rdk.length; i++) {
                          rdk[i] = 0;
                      }
          
          
          Severity: Minor
          Found in RCSBlackBerry/src/blackberry/crypto/Rijndael.java and 1 other location - About 40 mins to fix
          RCSBlackBerry/src/blackberry/crypto/Rijndael.java on lines 432..438

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 52.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                      TE0[i1] = t = (s2 << 24) | (s1 << 16) | (s1 << 8) | s3;
          Severity: Minor
          Found in RCSBlackBerry/src/blackberry/crypto/Rijndael.java and 1 other location - About 35 mins to fix
          RCSBlackBerry/src/blackberry/crypto/Rijndael.java on lines 167..167

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 46.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                      TD0[s1] = t = (ie << 24) | (i9 << 16) | (id << 8) | ib;
          Severity: Minor
          Found in RCSBlackBerry/src/blackberry/crypto/Rijndael.java and 1 other location - About 35 mins to fix
          RCSBlackBerry/src/blackberry/crypto/Rijndael.java on lines 161..161

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 46.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          There are no issues that match your filters.

          Category
          Status