connectbot/sshlib

View on GitHub
src/main/java/com/trilead/ssh2/crypto/cipher/DES.java

Summary

Maintainability
F
4 days
Test Coverage
B
89%

Method generateWorkingKey has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

    protected int[] generateWorkingKey(boolean encrypting, byte[] key, int off)
    {
        int[] newKey = new int[32];
        boolean[] pc1m = new boolean[56], pcr = new boolean[56];

Severity: Minor
Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java - About 3 hrs 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 desFunc has 79 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected void desFunc(int[] wKey, byte[] in, int inOff, byte[] out, int outOff)
    {
        int work, right, left;

        left = (in[inOff + 0] & 0xff) << 24;
Severity: Major
Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java - About 3 hrs to fix

    Method generateWorkingKey has 67 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected int[] generateWorkingKey(boolean encrypting, byte[] key, int off)
        {
            int[] newKey = new int[32];
            boolean[] pc1m = new boolean[56], pcr = new boolean[56];
    
    
    Severity: Major
    Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java - About 2 hrs to fix

      File DES.java has 274 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      
      package com.trilead.ssh2.crypto.cipher;
      
      /*
       * This file is based on the 3DES implementation from the Bouncy Castle Crypto package.
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java - About 2 hrs to fix

        Method desFunc has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            protected void desFunc(int[] wKey, byte[] in, int inOff, byte[] out, int outOff)
        Severity: Minor
        Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java - About 35 mins to fix

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

              static int[] SP4 = { 0x00802001, 0x00002081, 0x00002081, 0x00000080, 0x00802080, 0x00800081, 0x00800001,
                      0x00002001, 0x00000000, 0x00802000, 0x00802000, 0x00802081, 0x00000081, 0x00000000, 0x00800080, 0x00800001,
                      0x00000001, 0x00002000, 0x00800000, 0x00802001, 0x00000080, 0x00800000, 0x00002001, 0x00002080, 0x00800081,
                      0x00000001, 0x00002080, 0x00800080, 0x00002000, 0x00802080, 0x00802081, 0x00000081, 0x00800080, 0x00800001,
                      0x00802000, 0x00802081, 0x00000081, 0x00000000, 0x00000000, 0x00802000, 0x00002080, 0x00800080, 0x00800081,
          Severity: Major
          Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java and 7 other locations - About 2 hrs to fix
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 112..119
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 121..128
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 130..137
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 148..155
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 157..164
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 166..173
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 175..182

          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 134.

          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 8 locations. Consider refactoring.
          Open

              static int[] SP8 = { 0x10001040, 0x00001000, 0x00040000, 0x10041040, 0x10000000, 0x10001040, 0x00000040,
                      0x10000000, 0x00040040, 0x10040000, 0x10041040, 0x00041000, 0x10041000, 0x00041040, 0x00001000, 0x00000040,
                      0x10040000, 0x10000040, 0x10001000, 0x00001040, 0x00041000, 0x00040040, 0x10040040, 0x10041000, 0x00001040,
                      0x00000000, 0x00000000, 0x10040040, 0x10000040, 0x10001000, 0x00041040, 0x00040000, 0x00041040, 0x00040000,
                      0x10041000, 0x00001000, 0x00000040, 0x10040040, 0x00001000, 0x00041040, 0x10001000, 0x00000040, 0x10000040,
          Severity: Major
          Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java and 7 other locations - About 2 hrs to fix
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 112..119
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 121..128
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 130..137
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 139..146
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 148..155
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 157..164
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 166..173

          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 134.

          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 8 locations. Consider refactoring.
          Open

              static int[] SP7 = { 0x00200000, 0x04200002, 0x04000802, 0x00000000, 0x00000800, 0x04000802, 0x00200802,
                      0x04200800, 0x04200802, 0x00200000, 0x00000000, 0x04000002, 0x00000002, 0x04000000, 0x04200002, 0x00000802,
                      0x04000800, 0x00200802, 0x00200002, 0x04000800, 0x04000002, 0x04200000, 0x04200800, 0x00200002, 0x04200000,
                      0x00000800, 0x00000802, 0x04200802, 0x00200800, 0x00000002, 0x04000000, 0x00200800, 0x04000000, 0x00200800,
                      0x00200000, 0x04000802, 0x04000802, 0x04200002, 0x04200002, 0x00000002, 0x00200002, 0x04000000, 0x04000800,
          Severity: Major
          Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java and 7 other locations - About 2 hrs to fix
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 112..119
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 121..128
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 130..137
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 139..146
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 148..155
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 157..164
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 175..182

          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 134.

          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 8 locations. Consider refactoring.
          Open

              static int[] SP2 = { 0x80108020, 0x80008000, 0x00008000, 0x00108020, 0x00100000, 0x00000020, 0x80100020,
                      0x80008020, 0x80000020, 0x80108020, 0x80108000, 0x80000000, 0x80008000, 0x00100000, 0x00000020, 0x80100020,
                      0x00108000, 0x00100020, 0x80008020, 0x00000000, 0x80000000, 0x00008000, 0x00108020, 0x80100000, 0x00100020,
                      0x80000020, 0x00000000, 0x00108000, 0x00008020, 0x80108000, 0x80100000, 0x00008020, 0x00000000, 0x00108020,
                      0x80100020, 0x00100000, 0x80008020, 0x80100000, 0x80108000, 0x00008000, 0x80100000, 0x80008000, 0x00000020,
          Severity: Major
          Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java and 7 other locations - About 2 hrs to fix
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 112..119
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 130..137
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 139..146
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 148..155
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 157..164
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 166..173
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 175..182

          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 134.

          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 8 locations. Consider refactoring.
          Open

              static int[] SP5 = { 0x00000100, 0x02080100, 0x02080000, 0x42000100, 0x00080000, 0x00000100, 0x40000000,
                      0x02080000, 0x40080100, 0x00080000, 0x02000100, 0x40080100, 0x42000100, 0x42080000, 0x00080100, 0x40000000,
                      0x02000000, 0x40080000, 0x40080000, 0x00000000, 0x40000100, 0x42080100, 0x42080100, 0x02000100, 0x42080000,
                      0x40000100, 0x00000000, 0x42000000, 0x02080100, 0x02000000, 0x42000000, 0x00080100, 0x00080000, 0x42000100,
                      0x00000100, 0x02000000, 0x40000000, 0x02080000, 0x42000100, 0x40080100, 0x02000100, 0x40000000, 0x42080000,
          Severity: Major
          Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java and 7 other locations - About 2 hrs to fix
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 112..119
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 121..128
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 130..137
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 139..146
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 157..164
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 166..173
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 175..182

          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 134.

          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 8 locations. Consider refactoring.
          Open

              static int[] SP1 = { 0x01010400, 0x00000000, 0x00010000, 0x01010404, 0x01010004, 0x00010404, 0x00000004,
                      0x00010000, 0x00000400, 0x01010400, 0x01010404, 0x00000400, 0x01000404, 0x01010004, 0x01000000, 0x00000004,
                      0x00000404, 0x01000400, 0x01000400, 0x00010400, 0x00010400, 0x01010000, 0x01010000, 0x01000404, 0x00010004,
                      0x01000004, 0x01000004, 0x00010004, 0x00000000, 0x00000404, 0x00010404, 0x01000000, 0x00010000, 0x01010404,
                      0x00000004, 0x01010000, 0x01010400, 0x01000000, 0x01000000, 0x00000400, 0x01010004, 0x00010000, 0x00010400,
          Severity: Major
          Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java and 7 other locations - About 2 hrs to fix
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 121..128
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 130..137
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 139..146
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 148..155
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 157..164
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 166..173
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 175..182

          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 134.

          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 8 locations. Consider refactoring.
          Open

              static int[] SP3 = { 0x00000208, 0x08020200, 0x00000000, 0x08020008, 0x08000200, 0x00000000, 0x00020208,
                      0x08000200, 0x00020008, 0x08000008, 0x08000008, 0x00020000, 0x08020208, 0x00020008, 0x08020000, 0x00000208,
                      0x08000000, 0x00000008, 0x08020200, 0x00000200, 0x00020200, 0x08020000, 0x08020008, 0x00020208, 0x08000208,
                      0x00020200, 0x00020000, 0x08000208, 0x00000008, 0x08020208, 0x00000200, 0x08000000, 0x08020200, 0x08000000,
                      0x00020008, 0x00000208, 0x00020000, 0x08020200, 0x08000200, 0x00000000, 0x00000200, 0x00020008, 0x08020208,
          Severity: Major
          Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java and 7 other locations - About 2 hrs to fix
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 112..119
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 121..128
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 139..146
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 148..155
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 157..164
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 166..173
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 175..182

          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 134.

          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 8 locations. Consider refactoring.
          Open

              static int[] SP6 = { 0x20000010, 0x20400000, 0x00004000, 0x20404010, 0x20400000, 0x00000010, 0x20404010,
                      0x00400000, 0x20004000, 0x00404010, 0x00400000, 0x20000010, 0x00400010, 0x20004000, 0x20000000, 0x00004010,
                      0x00000000, 0x00400010, 0x20004010, 0x00004000, 0x00404000, 0x20004010, 0x00000010, 0x20400010, 0x20400010,
                      0x00000000, 0x00404010, 0x20404000, 0x00004010, 0x00404000, 0x20404000, 0x20000000, 0x20004000, 0x00000010,
                      0x20400010, 0x00404000, 0x20404010, 0x00400000, 0x00004010, 0x20000010, 0x00400000, 0x20004000, 0x20000000,
          Severity: Major
          Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java and 7 other locations - About 2 hrs to fix
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 112..119
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 121..128
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 130..137
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 139..146
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 148..155
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 166..173
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 175..182

          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 134.

          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

                      for (int j = 28; j < 56; j++)
                      {
                          l = j + totrot[i];
                          if (l < 56)
                          {
          Severity: Major
          Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java and 1 other location - About 1 hr to fix
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 219..230

          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 84.

          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

                      for (int j = 0; j < 28; j++)
                      {
                          l = j + totrot[i];
                          if (l < 28)
                          {
          Severity: Major
          Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java and 1 other location - About 1 hr to fix
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 232..243

          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 84.

          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

              static int[] bigbyte = { 0x800000, 0x400000, 0x200000, 0x100000, 0x80000, 0x40000, 0x20000, 0x10000, 0x8000,
                      0x4000, 0x2000, 0x1000, 0x800, 0x400, 0x200, 0x100, 0x80, 0x40, 0x20, 0x10, 0x8, 0x4, 0x2, 0x1 };
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java and 1 other location - About 45 mins to fix
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 91..92

          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 54.

          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

              static short[] Df_Key = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32,
                      0x10, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67 };
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java and 1 other location - About 45 mins to fix
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 96..97

          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 54.

          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

                      newKey[i + 1] = ((i1 & 0x0003f000) << 12) | ((i1 & 0x0000003f) << 16) | ((i2 & 0x0003f000) >>> 4)
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java and 1 other location - About 35 mins to fix
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 269..269

          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

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

                      newKey[i] = ((i1 & 0x00fc0000) << 6) | ((i1 & 0x00000fc0) << 10) | ((i2 & 0x00fc0000) >>> 10)
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java and 1 other location - About 35 mins to fix
          src/main/java/com/trilead/ssh2/crypto/cipher/DES.java on lines 272..272

          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