connectbot/sshlib

View on GitHub

Showing 244 of 412 total issues

Method authenticateInteractive has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public boolean authenticateInteractive(String user, String[] submethods, InteractiveCallback cb) throws IOException
    {
        try
        {
            initialize(user);
Severity: Minor
Found in src/main/java/com/trilead/ssh2/auth/AuthenticationManager.java - About 1 hr to fix

    Method readAttrs has 41 lines of code (exceeds 25 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 1 hr to fix

      Method rawFingerPrint has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static byte[] rawFingerPrint(String type, String keyType, byte[] hostkey)
          {
              MessageDigest dig = null;
      
              try {
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 1 hr to fix

        Method requestX11Forwarding has 40 lines of code (exceeds 25 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

          Method decodeSSHECDSASignature has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private byte[] decodeSSHECDSASignature(byte[] sig) throws IOException {
                  byte[] rsArray;
          
                  TypesReader tr = new TypesReader(sig);
          
          
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/signature/ECDSASHA2Verify.java - About 1 hr to fix

            Method uncompress has 40 lines of code (exceeds 25 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

              Method receiveMessage has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  public int receiveMessage(byte[] buffer, int off, int len) throws IOException
                  {
                      final int packetLength;
                      final int payloadLength;
              
              
              Severity: Minor
              Found in src/main/java/com/trilead/ssh2/transport/TransportConnection.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 read has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  public int read(byte[] b, int off, int len) throws IOException
                  {
                      if (b == null)
                          throw new NullPointerException();
              
              
              Severity: Minor
              Found in src/main/java/com/trilead/ssh2/StreamGobbler.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 decodeSignature has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  private byte[] decodeSignature(byte[] sig) throws IOException
                  {
                      byte[] rsArray = null;
              
                      if (sig.length == 40)
              Severity: Minor
              Found in src/main/java/com/trilead/ssh2/signature/DSASHA1Verify.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 put has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  public void put(String[] localFiles, String[] remoteFiles, String remoteTargetDirectory, String mode)
                          throws IOException
                  {
                      Session sess = 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 waitForChannelRequestResult has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  private boolean waitForChannelRequestResult(Channel c) throws IOException
                  {
                      synchronized (c)
                      {
                          while ((c.successCounter == 0) && (c.failedCounter == 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 encode has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static char[] encode(byte[] content)
                  {
                      CharArrayWriter cw = new CharArrayWriter((4 * content.length) / 3);
              
                      int idx = 0;
              Severity: Minor
              Found in src/main/java/com/trilead/ssh2/crypto/Base64.java - About 1 hr to fix

                Method pseudoRegex has 36 lines of code (exceeds 25 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 1 hr to fix

                  Method authenticateInteractive has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public boolean authenticateInteractive(String user, String[] submethods, InteractiveCallback cb) throws IOException
                      {
                          try
                          {
                              initialize(user);
                  Severity: Minor
                  Found in src/main/java/com/trilead/ssh2/auth/AuthenticationManager.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 run has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          public void run()
                          {
                              synchronized (todolist)
                              {
                                  while (true)
                  Severity: Minor
                  Found in src/main/java/com/trilead/ssh2/util/TimeoutService.java - About 1 hr to fix

                    Method requestGlobalForward has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public int requestGlobalForward(String bindAddress, int bindPort, String targetAddress, int targetPort)
                                throws IOException
                        {
                            RemoteForwardingData rfd = new RemoteForwardingData();
                    
                    
                    Severity: Minor
                    Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 1 hr to fix

                      Method write has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public void write(SFTPv3FileHandle handle, long fileOffset, byte[] src, int srcoff, int len) throws IOException
                          {
                              checkHandleValidAndOpen(handle);
                      
                              while (len > 0)
                      Severity: Minor
                      Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 1 hr to fix

                        Method createAttrs has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private byte[] createAttrs(SFTPv3FileAttributes attr)
                            {
                                TypesWriter tw = new TypesWriter();
                        
                                int attrFlags = 0;
                        Severity: Minor
                        Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 1 hr to fix

                          Method put has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            Method addHostkeyToFile has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public final static void addHostkeyToFile(File knownHosts, String[] hostnames, String serverHostKeyAlgorithm,
                                        byte[] serverHostKey) throws IOException
                                {
                                    if ((hostnames == null) || (hostnames.length == 0))
                                        throw new IllegalArgumentException("Need at least one hostname specification");
                            Severity: Minor
                            Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language