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

      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

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

        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

        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

        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[] 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

                  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

                  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

                  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

                  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

                  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

                  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
                  Severity
                  Category
                  Status
                  Source
                  Language