connectbot/sshlib

View on GitHub

Showing 412 of 412 total issues

File ChannelManager.java has 1306 lines of code (exceeds 250 allowed). Consider refactoring.
Open


package com.trilead.ssh2.channel;

import java.io.IOException;
import java.util.ArrayList;
Severity: Major
Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 3 days to fix

    File SFTPv3Client.java has 763 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    
    package com.trilead.ssh2;
    
    import java.io.BufferedOutputStream;
    import java.io.IOException;
    Severity: Major
    Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 1 day to fix

      Method handleMessage has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring.
      Open

          public synchronized void handleMessage(byte[] msg, int msglen) throws IOException
          {
              PacketKexInit kip;
      
              if (msg == null)
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/transport/KexManager.java - About 1 day 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 decode has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring.
      Open

          public static KeyPair decode(PEMStructure ps, String password) throws IOException
          {
              if (isPEMEncrypted(ps) && ps.pemType != PEM_OPENSSH_PRIVATE_KEY)
              {
                  if (password == null)
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/crypto/PEMDecoder.java - About 1 day 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 KexManager.java has 607 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      
      package com.trilead.ssh2.transport;
      
      import com.trilead.ssh2.signature.RSASHA256Verify;
      import com.trilead.ssh2.signature.RSASHA512Verify;
      Severity: Major
      Found in src/main/java/com/trilead/ssh2/transport/KexManager.java - About 1 day to fix

        File KnownHosts.java has 601 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        
        package com.trilead.ssh2;
        
        import java.io.BufferedReader;
        import java.io.CharArrayReader;
        Severity: Major
        Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 1 day to fix

          File Connection.java has 561 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          
          package com.trilead.ssh2;
          
          import java.io.CharArrayWriter;
          import java.io.File;
          Severity: Major
          Found in src/main/java/com/trilead/ssh2/Connection.java - About 1 day to fix

            Method handleMessage has 225 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public synchronized void handleMessage(byte[] msg, int msglen) throws IOException
                {
                    PacketKexInit kip;
            
                    if (msg == null)
            Severity: Major
            Found in src/main/java/com/trilead/ssh2/transport/KexManager.java - About 1 day to fix

              File PEMDecoder.java has 526 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              
              package com.trilead.ssh2.crypto;
              
              import java.io.BufferedReader;
              import java.io.CharArrayReader;
              Severity: Major
              Found in src/main/java/com/trilead/ssh2/crypto/PEMDecoder.java - About 1 day to fix

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

                    KS2 = { 0xE93D5A68, 0x948140F7, 0xF64C261C, 0x94692934, 0x411520F7, 0x7602D4F7, 0xBCF46B2E, 0xD4A20068, 0xD4082471,
                            0x3320F46A, 0x43B7D4B7, 0x500061AF, 0x1E39F62E, 0x97244546, 0x14214F74, 0xBF8B8840, 0x4D95FC1D, 0x96B591AF,
                            0x70F4DDD3, 0x66A02F45, 0xBFBC09EC, 0x03BD9785, 0x7FAC6DD0, 0x31CB8504, 0x96EB27B3, 0x55FD3941, 0xDA2547E6,
                            0xABCA0A9A, 0x28507825, 0x530429F4, 0x0A2C86DA, 0xE9B66DFB, 0x68DC1462, 0xD7486900, 0x680EC0A4, 0x27A18DEE,
                            0x4F3FFEA2, 0xE887AD8C, 0xB58CE006, 0x7AF4D6B6, 0xAACE1E7C, 0xD3375FEC, 0xCE78A399, 0x406B2A42, 0x20FE9E35,
                Severity: Major
                Found in src/main/java/com/trilead/ssh2/crypto/cipher/BlowFish.java and 3 other locations - About 1 day to fix
                src/main/java/com/trilead/ssh2/crypto/cipher/BlowFish.java on lines 45..73
                src/main/java/com/trilead/ssh2/crypto/cipher/BlowFish.java on lines 75..103
                src/main/java/com/trilead/ssh2/crypto/cipher/BlowFish.java on lines 135..163

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

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

                    KS3 = { 0x3A39CE37, 0xD3FAF5CF, 0xABC27737, 0x5AC52D1B, 0x5CB0679E, 0x4FA33742, 0xD3822740, 0x99BC9BBE, 0xD5118E9D,
                            0xBF0F7315, 0xD62D1C7E, 0xC700C47B, 0xB78C1B6B, 0x21A19045, 0xB26EB1BE, 0x6A366EB4, 0x5748AB2F, 0xBC946E79,
                            0xC6A376D2, 0x6549C2C8, 0x530FF8EE, 0x468DDE7D, 0xD5730A1D, 0x4CD04DC6, 0x2939BBDB, 0xA9BA4650, 0xAC9526E8,
                            0xBE5EE304, 0xA1FAD5F0, 0x6A2D519A, 0x63EF8CE2, 0x9A86EE22, 0xC089C2B8, 0x43242EF6, 0xA51E03AA, 0x9CF2D0A4,
                            0x83C061BA, 0x9BE96A4D, 0x8FE51550, 0xBA645BD6, 0x2826A2F9, 0xA73A3AE1, 0x4BA99586, 0xEF5562E9, 0xC72FEFD3,
                Severity: Major
                Found in src/main/java/com/trilead/ssh2/crypto/cipher/BlowFish.java and 3 other locations - About 1 day to fix
                src/main/java/com/trilead/ssh2/crypto/cipher/BlowFish.java on lines 45..73
                src/main/java/com/trilead/ssh2/crypto/cipher/BlowFish.java on lines 75..103
                src/main/java/com/trilead/ssh2/crypto/cipher/BlowFish.java on lines 105..133

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

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

                    KS1 = { 0x4B7A70E9, 0xB5B32944, 0xDB75092E, 0xC4192623, 0xAD6EA6B0, 0x49A7DF7D, 0x9CEE60B8, 0x8FEDB266, 0xECAA8C71,
                            0x699A17FF, 0x5664526C, 0xC2B19EE1, 0x193602A5, 0x75094C29, 0xA0591340, 0xE4183A3E, 0x3F54989A, 0x5B429D65,
                            0x6B8FE4D6, 0x99F73FD6, 0xA1D29C07, 0xEFE830F5, 0x4D2D38E6, 0xF0255DC1, 0x4CDD2086, 0x8470EB26, 0x6382E9C6,
                            0x021ECC5E, 0x09686B3F, 0x3EBAEFC9, 0x3C971814, 0x6B6A70A1, 0x687F3584, 0x52A0E286, 0xB79C5305, 0xAA500737,
                            0x3E07841C, 0x7FDEAE5C, 0x8E7D44EC, 0x5716F2B8, 0xB03ADA37, 0xF0500C0D, 0xF01C1F04, 0x0200B3FF, 0xAE0CF51A,
                Severity: Major
                Found in src/main/java/com/trilead/ssh2/crypto/cipher/BlowFish.java and 3 other locations - About 1 day to fix
                src/main/java/com/trilead/ssh2/crypto/cipher/BlowFish.java on lines 45..73
                src/main/java/com/trilead/ssh2/crypto/cipher/BlowFish.java on lines 105..133
                src/main/java/com/trilead/ssh2/crypto/cipher/BlowFish.java on lines 135..163

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

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

                    KS0 = { 0xD1310BA6, 0x98DFB5AC, 0x2FFD72DB, 0xD01ADFB7, 0xB8E1AFED, 0x6A267E96, 0xBA7C9045, 0xF12C7F99, 0x24A19947,
                            0xB3916CF7, 0x0801F2E2, 0x858EFC16, 0x636920D8, 0x71574E69, 0xA458FEA3, 0xF4933D7E, 0x0D95748F, 0x728EB658,
                            0x718BCD58, 0x82154AEE, 0x7B54A41D, 0xC25A59B5, 0x9C30D539, 0x2AF26013, 0xC5D1B023, 0x286085F0, 0xCA417918,
                            0xB8DB38EF, 0x8E79DCB0, 0x603A180E, 0x6C9E0E8B, 0xB01E8A3E, 0xD71577C1, 0xBD314B27, 0x78AF2FDA, 0x55605C60,
                            0xE65525F3, 0xAA55AB94, 0x57489862, 0x63E81440, 0x55CA396A, 0x2AAB10B6, 0xB4CC5C34, 0x1141E8CE, 0xA15486AF,
                Severity: Major
                Found in src/main/java/com/trilead/ssh2/crypto/cipher/BlowFish.java and 3 other locations - About 1 day to fix
                src/main/java/com/trilead/ssh2/crypto/cipher/BlowFish.java on lines 75..103
                src/main/java/com/trilead/ssh2/crypto/cipher/BlowFish.java on lines 105..133
                src/main/java/com/trilead/ssh2/crypto/cipher/BlowFish.java on lines 135..163

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

                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 receiveLoop has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
                Open

                    public void receiveLoop() throws IOException
                    {
                        byte[] msg = new byte[35004];
                
                        while (true)
                Severity: Minor
                Found in src/main/java/com/trilead/ssh2/transport/TransportManager.java - About 1 day 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 decode has 194 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static KeyPair decode(PEMStructure ps, String password) throws IOException
                    {
                        if (isPEMEncrypted(ps) && ps.pemType != PEM_OPENSSH_PRIVATE_KEY)
                        {
                            if (password == null)
                Severity: Major
                Found in src/main/java/com/trilead/ssh2/crypto/PEMDecoder.java - About 7 hrs to fix

                  Connection has 53 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public class Connection implements AutoCloseable
                  {
                      /**
                       * The identifier presented to the SSH-2 server.
                       */
                  Severity: Major
                  Found in src/main/java/com/trilead/ssh2/Connection.java - About 7 hrs to fix

                    File TransportManager.java has 469 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    
                    package com.trilead.ssh2.transport;
                    
                    import com.trilead.ssh2.ExtensionInfo;
                    import com.trilead.ssh2.packets.PacketExtInfo;
                    Severity: Minor
                    Found in src/main/java/com/trilead/ssh2/transport/TransportManager.java - About 7 hrs to fix

                      File AuthAgentForwardThread.java has 456 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /*
                       * Copyright 2007 Kenny Root, Jeffrey Sharkey
                       *
                       * Redistribution and use in source and binary forms, with or without
                       * modification, are permitted provided that the following conditions
                      Severity: Minor
                      Found in src/main/java/com/trilead/ssh2/channel/AuthAgentForwardThread.java - About 6 hrs to fix

                        Method pseudoRegex has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private final boolean pseudoRegex(char[] pattern, int i, char[] match, int j)
                            {
                                /* This matching logic is equivalent to the one present in OpenSSH 4.1 */
                        
                                while (true)
                        Severity: Minor
                        Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 6 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 SCPClient.java has 448 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        
                        package com.trilead.ssh2;
                        
                        import java.io.BufferedInputStream;
                        import java.io.BufferedOutputStream;
                        Severity: Minor
                        Found in src/main/java/com/trilead/ssh2/SCPClient.java - About 6 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language