connectbot/sshlib

View on GitHub

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

      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 decryptData has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            private static byte[] decryptData(byte[] data, byte[] pw, byte[] salt, int rounds, String algo) throws IOException
        Severity: Minor
        Found in src/main/java/com/trilead/ssh2/crypto/PEMDecoder.java - About 35 mins to fix

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

              protected void desFunc(int[] wKey, byte[] in, int inOff, byte[] out, int outOff)
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java - About 35 mins to fix

            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

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

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

            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 receiveLine has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                private String receiveLine(InputStream is) throws IOException
                {
                    StringBuffer sb = new StringBuffer(30);
            
                    while (true)
            Severity: Minor
            Found in src/main/java/com/trilead/ssh2/SCPClient.java - About 35 mins 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 msgChannelData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public void msgChannelData(byte[] msg, int msglen) throws IOException
                {
                    if (msglen <= 9)
                        throw new IOException("SSH_MSG_CHANNEL_DATA message has wrong size (" + msglen + ")");
            
            
            Severity: Minor
            Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 35 mins 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 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

            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

            Avoid too many return statements within this method.
            Open

                            return;
            Severity: Major
            Found in src/main/java/com/trilead/ssh2/channel/AuthAgentForwardThread.java - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return;
              Severity: Major
              Found in src/main/java/com/trilead/ssh2/transport/KexManager.java - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return len;
                Severity: Major
                Found in src/main/java/com/trilead/ssh2/crypto/SimpleDERReader.java - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                              return;
                  Severity: Major
                  Found in src/main/java/com/trilead/ssh2/transport/KexManager.java - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                            return;
                    Severity: Major
                    Found in src/main/java/com/trilead/ssh2/channel/AuthAgentForwardThread.java - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return;
                      Severity: Major
                      Found in src/main/java/com/trilead/ssh2/transport/KexManager.java - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return;
                        Severity: Major
                        Found in src/main/java/com/trilead/ssh2/transport/KexManager.java - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return;
                          Severity: Major
                          Found in src/main/java/com/trilead/ssh2/channel/AuthAgentForwardThread.java - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                                    return false;
                            Severity: Major
                            Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language