connectbot/sshlib

View on GitHub

Showing 415 of 415 total issues

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

public void write(SFTPv3FileHandle handle, long fileOffset, byte[] src, int srcoff, int len) throws IOException
Severity: Minor
Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 35 mins to fix

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

    public int getChannelData(Channel c, boolean extended, byte[] target, int off, int len) throws IOException
    Severity: Minor
    Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 35 mins to fix

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

      public void resizePTY(Channel c, int term_width_characters, int term_height_characters,
      int term_width_pixels, int term_height_pixels) throws IOException {
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 35 mins to fix

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

        public byte[] calculateH(byte[] clientversion, byte[] serverversion, byte[] clientKexPayload,
        byte[] serverKexPayload, byte[] hostKey) throws UnsupportedEncodingException
        Severity: Minor
        Found in src/main/java/com/trilead/ssh2/crypto/dh/GenericDhExchange.java - About 35 mins to fix

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

          public CipherOutputStream(BlockCipher tc, OutputStream bo)
          {
          if (bo instanceof BufferedOutputStream) {
          this.bo = (BufferedOutputStream) bo;
          } else {
          src/main/java/com/trilead/ssh2/crypto/cipher/CipherInputStream.java on lines 23..31

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

          public CipherInputStream(BlockCipher tc, InputStream bi)
          {
          if (bi instanceof BufferedInputStream) {
          this.bi = (BufferedInputStream) bi;
          } else {
          src/main/java/com/trilead/ssh2/crypto/cipher/CipherOutputStream.java on lines 26..34

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

          public void changeRecvCompression(ICompressor comp)
          {
          recv_comp = comp;
           
          if (comp != null) {
          src/main/java/com/trilead/ssh2/transport/TransportConnection.java on lines 126..134

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

          while (read_pos == write_pos)
          {
          if (exception != null)
          throw exception;
           
           
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/StreamGobbler.java and 1 other location - About 35 mins to fix
          src/main/java/com/trilead/ssh2/StreamGobbler.java on lines 201..216

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

          if (signatureProxy != null)
          {
          rsa_sig_enc = signatureProxy.sign(msg, SignatureProxy.SHA256);
          }
          else
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/auth/AuthenticationManager.java and 1 other location - About 35 mins to fix
          src/main/java/com/trilead/ssh2/auth/AuthenticationManager.java on lines 275..283

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

          if (log.isEnabled())
          {
          log.log(90, "Sent " + Packets.getMessageName(message[off] & 0xff) + " " + len + " bytes payload");
          }
          src/main/java/com/trilead/ssh2/transport/TransportConnection.java on lines 306..309

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

          public void changeSendCompression(ICompressor comp)
          {
          send_comp = comp;
           
          if (comp != null) {
          src/main/java/com/trilead/ssh2/transport/TransportConnection.java on lines 116..124

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

          while (read_pos == write_pos)
          {
          if (exception != null)
          throw exception;
           
           
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/StreamGobbler.java and 1 other location - About 35 mins to fix
          src/main/java/com/trilead/ssh2/StreamGobbler.java on lines 133..148

          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

          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

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

          if (signatureProxy != null)
          {
          rsa_sig_enc = signatureProxy.sign(msg, SignatureProxy.SHA1);
          }
          else
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/auth/AuthenticationManager.java and 1 other location - About 35 mins to fix
          src/main/java/com/trilead/ssh2/auth/AuthenticationManager.java on lines 262..269

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

          if (log.isEnabled()) {
          log.log(90, "Received " + Packets.getMessageName(buffer[off] & 0xff) + " " + payloadLength
          + " bytes payload");
          }
          src/main/java/com/trilead/ssh2/transport/TransportConnection.java on lines 249..252

          Method readLink has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          public String readLink(String path) throws IOException
          {
          int req_id = generateNextRequestID();
           
          TypesWriter tw = new TypesWriter();
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 35 mins to fix

          Method canonicalPath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          public String canonicalPath(String path) throws IOException
          {
          int req_id = generateNextRequestID();
           
          TypesWriter tw = new TypesWriter();
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 35 mins to fix

          Method readOid has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          public String readOid() throws IOException
          {
          int type = readByte() & 0xff;
           
          if (type != 0x06)
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/crypto/SimpleDERReader.java - About 35 mins to fix

          Method initialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          private void initialize(char[] knownHostsData) throws IOException
          {
          BufferedReader br = new BufferedReader(new CharArrayReader(knownHostsData));
           
          while (true)
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 35 mins to fix
          Severity
          Category
          Status
          Source
          Language