connectbot/sshlib

View on GitHub

Showing 244 of 412 total issues

Method openDirectory has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private final byte[] openDirectory(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 1 hr to fix

    Method init has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @Override
        public void init(String name) throws IOException {
            final DHParameterSpec spec;
            if ("diffie-hellman-group18-sha512".equals(name)) {
                spec = new DHParameterSpec(P18, G);
    Severity: Minor
    Found in src/main/java/com/trilead/ssh2/crypto/dh/DhExchange.java - About 1 hr to fix

      Method checkHashed has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private final boolean checkHashed(String entry, String hostname)
          {
              if (!entry.startsWith("|1|"))
                  return false;
      
      
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 1 hr to fix

        Method get has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public void get(String remoteFiles[], String localTargetDirectory) throws IOException
            {
                Session sess = null;
        
                if ((remoteFiles == null) || (localTargetDirectory == null))
        Severity: Minor
        Found in src/main/java/com/trilead/ssh2/SCPClient.java - About 1 hr to fix

          Method rawToBubblebabbleFingerprint has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              static final private String rawToBubblebabbleFingerprint(byte[] raw)
              {
                  final char[] v = "aeiouy".toCharArray();
                  final char[] c = "bcdfghklmnprstvzx".toCharArray();
          
          
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 1 hr to fix

            Method fstat has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public SFTPv3FileAttributes fstat(SFTPv3FileHandle handle) throws IOException
                {
                    checkHandleValidAndOpen(handle);
            
                    int req_id = generateNextRequestID();
            Severity: Minor
            Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 1 hr to fix

              Method decode has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private static byte[] decode(PKCS8EncodedKeySpec keySpec) throws InvalidKeySpecException {
                      byte[] encoded = keySpec.getEncoded();
                      if (encoded.length != ENCODED_SIZE) {
                          throw new InvalidKeySpecException("Key spec is of invalid size");
                      }
              Severity: Minor
              Found in src/main/java/com/trilead/ssh2/crypto/keys/Ed25519PrivateKey.java - About 1 hr to fix

                Method msgChannelExtendedData has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public void msgChannelExtendedData(byte[] msg, int msglen) throws IOException
                    {
                        if (msglen <= 13)
                            throw new IOException("SSH_MSG_CHANNEL_EXTENDED_DATA message has wrong size (" + msglen + ")");
                
                
                Severity: Minor
                Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 1 hr to fix

                  Method calculateKey has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private static byte[] calculateKey(HashForSSH2Types sh, BigInteger K, byte[] H, byte type, byte[] SessionID,
                              int keyLength)
                      {
                          byte[] res = new byte[keyLength];
                  
                  
                  Severity: Minor
                  Found in src/main/java/com/trilead/ssh2/crypto/KeyMaterial.java - About 1 hr to fix

                    Method statBoth has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private SFTPv3FileAttributes statBoth(String path, int statMethod) throws IOException
                        {
                            int req_id = generateNextRequestID();
                    
                            TypesWriter tw = new TypesWriter();
                    Severity: Minor
                    Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 1 hr to fix

                      Method requestCancelGlobalForward has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public void requestCancelGlobalForward(int bindPort) throws IOException
                          {
                              RemoteForwardingData rfd = null;
                      
                              synchronized (remoteForwardings)
                      Severity: Minor
                      Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 1 hr to fix

                        Method parseCLine has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private LenNamePair parseCLine(String line) throws IOException
                            {
                                /* Minimum line: "xxxx y z" ---> 8 chars */
                        
                                long len;
                        Severity: Minor
                        Found in src/main/java/com/trilead/ssh2/SCPClient.java - About 1 hr to fix

                          Method run has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                                      public void run()
                                      {
                                          try
                                          {
                                              receiveLoop();
                          Severity: Minor
                          Found in src/main/java/com/trilead/ssh2/transport/TransportManager.java - About 1 hr 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 sendMessage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public void sendMessage(byte[] msg) throws IOException
                              {
                                  if (Thread.currentThread() == receiveThread)
                                      throw new IOException("Assertion error: sendMessage may never be invoked by the receiver thread!");
                          
                          
                          Severity: Minor
                          Found in src/main/java/com/trilead/ssh2/transport/TransportManager.java - About 1 hr 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 verifySignature has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private boolean verifySignature(byte[] sig, byte[] hostkey) throws IOException {
                                  SSHSignature sshSignature;
                                  if (kxs.np.server_host_key_algo.equals(Ed25519Verify.get().getKeyFormat())) {
                                      sshSignature = Ed25519Verify.get();
                                  } else if (kxs.np.server_host_key_algo.equals(ECDSASHA2Verify.ECDSASHA2NISTP256Verify.get().getKeyFormat())) {
                          Severity: Minor
                          Found in src/main/java/com/trilead/ssh2/transport/KexManager.java - About 1 hr 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 requestX11Forwarding has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public void requestX11Forwarding(String hostname, int port, byte[] cookie, boolean singleConnection)
                                      throws IOException
                              {
                                  if (hostname == null)
                                      throw new IllegalArgumentException("hostname argument may not be null");
                          Severity: Minor
                          Found in src/main/java/com/trilead/ssh2/Session.java - About 1 hr 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 waitForGlobalRequestResult has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private boolean waitForGlobalRequestResult() throws IOException
                              {
                                  synchronized (channels)
                                  {
                                      while ((globalSuccessCounter == 0) && (globalFailedCounter == 0))
                          Severity: Minor
                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 1 hr 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 uncompress has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public byte[] uncompress(byte[] buffer, int start, int[] length) {
                                  int inflated_end = 0;
                          
                                  inflate.next_in = buffer;
                                  inflate.next_in_index = start;
                          Severity: Minor
                          Found in src/main/java/com/trilead/ssh2/compression/Zlib.java - About 1 hr 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 get has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public void get(String remoteFiles[], String localTargetDirectory) throws IOException
                              {
                                  Session sess = null;
                          
                                  if ((remoteFiles == null) || (localTargetDirectory == null))
                          Severity: Minor
                          Found in src/main/java/com/trilead/ssh2/SCPClient.java - About 1 hr 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 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private boolean initialize(String user) throws IOException
                              {
                                  if (!initDone)
                                  {
                                      tm.registerMessageHandler(this, 0, 255);
                          Severity: Minor
                          Found in src/main/java/com/trilead/ssh2/auth/AuthenticationManager.java - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language