connectbot/sshlib

View on GitHub

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

                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

                          ChannelManager has 46 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                          public class ChannelManager implements MessageHandler
                          {
                              private static final Logger log = Logger.getLogger(ChannelManager.class);
                          
                              private final HashMap<String, X11ServerData> x11_magic_cookies = new HashMap<>();
                          Severity: Minor
                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 6 hrs to fix

                            File AuthenticationManager.java has 418 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            
                            package com.trilead.ssh2.auth;
                            
                            import com.trilead.ssh2.crypto.keys.Ed25519PrivateKey;
                            import com.trilead.ssh2.crypto.keys.Ed25519PublicKey;
                            Severity: Minor
                            Found in src/main/java/com/trilead/ssh2/auth/AuthenticationManager.java - About 6 hrs to fix

                              Method hostnameMatches has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  private final boolean hostnameMatches(String[] hostpatterns, String hostname)
                                  {
                                      boolean isMatch = false;
                                      boolean negate = false;
                              
                              
                              Severity: Minor
                              Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 5 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 ECDSASHA2Verify.java has 405 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /*
                               * Copyright 2014 Kenny Root
                               *
                               * 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/signature/ECDSASHA2Verify.java - About 5 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language