connectbot/sshlib

View on GitHub

Showing 412 of 412 total issues

Method receiveFiles has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void receiveFiles(Session sess, String[] files, String target) throws IOException
    {
        byte[] buffer = new byte[8192];

        OutputStream os = new BufferedOutputStream(sess.getStdin(), 512);
Severity: Major
Found in src/main/java/com/trilead/ssh2/SCPClient.java - About 2 hrs to fix

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

    public class KnownHosts
    {
        public static final int HOSTKEY_IS_OK = 0;
        public static final int HOSTKEY_IS_NEW = 1;
        public static final int HOSTKEY_HAS_CHANGED = 2;
    Severity: Minor
    Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 2 hrs to fix

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

          public PacketUserauthRequestPassword(byte payload[], int off, int len) throws IOException
          {
              this.payload = new byte[len];
              System.arraycopy(payload, off, this.payload, 0, len);
      
      
      src/main/java/com/trilead/ssh2/packets/PacketUserauthRequestNone.java on lines 25..47

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

      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 PacketUserauthRequestNone(byte payload[], int off, int len) throws IOException
          {
              this.payload = new byte[len];
              System.arraycopy(payload, off, this.payload, 0, len);
      
      
      src/main/java/com/trilead/ssh2/packets/PacketUserauthRequestPassword.java on lines 27..51

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

      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

      Method msgChannelRequest has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public void msgChannelRequest(byte[] msg, int msglen) throws IOException
          {
              TypesReader tr = new TypesReader(msg, 0, msglen);
      
              tr.readByte(); // skip packet type
      Severity: Major
      Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 2 hrs to fix

        Method readAttrs has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            private SFTPv3FileAttributes readAttrs(TypesReader tr) throws IOException
            {
                /*
                 * uint32   flags
                 * uint64   size           present only if flag SSH_FILEXFER_ATTR_SIZE
        Severity: Minor
        Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 2 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 initialize has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            public void initialize(CryptoWishList cwl, ServerHostKeyVerifier verifier, DHGexParameters dhgex,
                    int connectTimeout, SecureRandom rnd, ProxyData proxyData) throws IOException
            {
                /* First, establish the TCP connection to the SSH-2 server */
        
        
        Severity: Minor
        Found in src/main/java/com/trilead/ssh2/transport/TransportManager.java - About 2 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 sendFiles has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            private void sendFiles(Session sess, String[] files, String[] remoteFiles, String mode) throws IOException
            {
                byte[] buffer = new byte[8192];
        
                OutputStream os = new BufferedOutputStream(sess.getStdin(), 40000);
        Severity: Minor
        Found in src/main/java/com/trilead/ssh2/SCPClient.java - About 2 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

        File TransportConnection.java has 257 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        
        package com.trilead.ssh2.transport;
        
        import java.io.IOException;
        import java.io.InputStream;
        Severity: Minor
        Found in src/main/java/com/trilead/ssh2/transport/TransportConnection.java - About 2 hrs to fix

          ECDSASHA2Verify has 21 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public abstract class ECDSASHA2Verify implements SSHSignature {
              private static final Logger log = Logger.getLogger(ECDSASHA2Verify.class);
          
              public static final String ECDSA_SHA2_PREFIX = "ecdsa-sha2-";
          
          
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/signature/ECDSASHA2Verify.java - About 2 hrs to fix

            Method mergeKexParameters has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private NegotiatedParameters mergeKexParameters(KexParameters client, KexParameters server)
                {
                    NegotiatedParameters np = new NegotiatedParameters();
            
                    try
            Severity: Major
            Found in src/main/java/com/trilead/ssh2/transport/KexManager.java - About 2 hrs to fix

              Method sendFiles has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private void sendFiles(Session sess, String[] files, String[] remoteFiles, String mode) throws IOException
                  {
                      byte[] buffer = new byte[8192];
              
                      OutputStream os = new BufferedOutputStream(sess.getStdin(), 40000);
              Severity: Major
              Found in src/main/java/com/trilead/ssh2/SCPClient.java - About 2 hrs to fix

                Method sendData has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public void sendData(Channel c, byte[] buffer, int pos, int len) throws IOException
                    {
                        while (len > 0)
                        {
                            int thislen = 0;
                Severity: Major
                Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 2 hrs 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

                  Severity
                  Category
                  Status
                  Source
                  Language